N25q128#

group drv_n25q128

Driver for the Micron N25Q128 flash memory driver.

Author

Alexandre Abadie alexandre.abadie@inria.fr

Copyright

Inria, 2024-present

Defines

N25Q128_PAGE_SIZE#

size in Bytes

N25Q128_PAGE_COUNT#

65536

N25Q128_SECTOR_SIZE#

64KB

N25Q128_MAIN_SECTOR_COUNT#

248

N25Q125_BOOT_SECTOR_COUNT#

8 * 64KB

N25Q128_MAIN_MEMORY_BOTTOM_START_ADDRESS#

3-bytes address

N25Q128_MAIN_MEMORY_TOP_START_ADDRESS#

3-bytes address

N25Q128_MAIN_MEMORY_UNIFORM_START_ADDRESS#

3-bytes address

N25Q128_ADDRESS_LENGTH#

3-bytes length address

N25Q128_MANUFACTURER#
N25Q128_MEMORY_TYPE#
N25Q128_MEMORY_CAPACITY#

128Mbit

N25Q128_EDID_LENGTH#
N25Q128_EDID_VCR_XIP_MASK#
N25Q128_EDID_HOLD_RESET_MASK#
N25Q128_EDID_ADRESSING_MASK#
N25Q128_EDID_ARCHITECTURE_MASK#

Enums

enum n25q128_architecture_t#

N25Q128 architecture types.

Values:

enumerator N25Q128_ARCHITECTURE_UNIFORM#
enumerator N25Q128_ARCHITECTURE_BOTTOM#
enumerator N25Q128_ARCHITECTURE_TOP#

Functions

void n25q128_init(const n25q128_conf_t *conf)#

Initializes the N25Q128 flash memory.

Parameters:
  • conf[in] pointer to the init configuration

void n25q128_base_address(uint32_t *address)#

Returns the memory base address from the read identification.

Parameters:
  • address[out] pointer to result base address

void n25q128_read_status_register(uint8_t *status)#

Reads status register.

Parameters:
  • status[out] pointer to the output status byte

void n25q128_program_page(uint32_t address, uint8_t *in, size_t length)#

Write data in a page.

Parameters:
  • address[in] address (only the 3 lower bytes are used)

  • in[in] pointer to input array

  • length[in] number of bytes to program

void n25q128_sector_erase(uint32_t address)#

Erase a sector on the flash memory.

Parameters:
  • address[in] address (only the 3 lower bytes are used)

void n25q128_write_enable(void)#

Enable flash write.

void n25q128_write_disable(void)#

Disable flash write.

void n25q128_bulk_erase(void)#

Erase whole flash memory.

void n25q128_read(uint32_t address, uint8_t *out, size_t length)#

Read data on flash memory.

Parameters:
  • address[in] address (only the 3 lower bytes are used)

  • out[out] pointer to the destination array

  • length[in] number of bytes to read

struct n25q128_identification_t#

Identification data.

Public Members

uint8_t manufacturer#

Manufacturer.

uint8_t memory_type#

Memory type.

uint8_t memory_size#

Memory size.

uint8_t uid_length#

Length of Extended device ID + Customized Factory Data.

uint8_t edid#

Extended device ID.

struct n25q128_conf_t#

N25Q128 init configuration.

Public Members

const gpio_t *sck#

SCK gpio.

const gpio_t *mosi#

MOSI gpio.

const gpio_t *miso#

MISO gpio.

const gpio_t *cs#

CS gpio.