|
PebbleOS
|
Generic QSPI NOR flash driver, used by the part drivers to implement Low-level flash driver. More...
Functions | |
| void | qspi_flash_init (QSPIFlash *dev, QSPIFlashPart *part, bool coredump_mode) |
| Initialize a QSPI flash device. | |
| bool | qspi_flash_is_in_coredump_mode (QSPIFlash *dev) |
| Check whether the device was initialized in core dump mode. | |
| bool | qspi_flash_check_whoami (QSPIFlash *dev) |
| Check the JEDEC ID against the part description. | |
| status_t | qspi_flash_is_erase_complete (QSPIFlash *dev) |
| Check whether an erase has completed. | |
| status_t | qspi_flash_erase_begin (QSPIFlash *dev, uint32_t addr, bool is_subsector) |
| Start an erase. | |
| status_t | qspi_flash_erase_suspend (QSPIFlash *dev, uint32_t addr) |
| Suspend an in-progress erase. | |
| void | qspi_flash_erase_resume (QSPIFlash *dev, uint32_t addr) |
| Resume a suspended erase. | |
| void | qspi_flash_read_blocking (QSPIFlash *dev, uint32_t addr, void *buffer, uint32_t length) |
| Read data, blocking. | |
| int | qspi_flash_write_page_begin (QSPIFlash *dev, const void *buffer, uint32_t addr, uint32_t length) |
| Start writing up to a page. | |
| status_t | qspi_flash_get_write_status (QSPIFlash *dev) |
| Poll the status of a page write. | |
| void | qspi_flash_set_lower_power_mode (QSPIFlash *dev, bool active) |
| Enter or leave deep power-down. | |
| status_t | qspi_flash_blank_check (QSPIFlash *dev, uint32_t addr, bool is_subsector) |
| Check whether a sector or subsector is blank. | |
| status_t | qspi_flash_write_protection_enable (QSPIFlash *dev) |
| Enable write and erase protection. | |
| status_t | qspi_flash_lock_sector (QSPIFlash *dev, uint32_t addr) |
| Lock a sector against writes and erases. | |
| status_t | qspi_flash_unlock_all (QSPIFlash *dev) |
Unlock all sectors, with the block_unlock_all instruction. | |
| status_t | qspi_flash_read_security_register (QSPIFlash *dev, uint32_t addr, uint8_t *val) |
| Read a byte from a security register. | |
| status_t | qspi_flash_security_register_is_locked (QSPIFlash *dev, uint32_t address, bool *locked) |
| Check whether a security register is locked. | |
| status_t | qspi_flash_erase_security_register (QSPIFlash *dev, uint32_t addr) |
| Erase a security register. | |
| status_t | qspi_flash_write_security_register (QSPIFlash *dev, uint32_t addr, uint8_t val) |
| Write a byte to a security register. | |
| const FlashSecurityRegisters * | qspi_flash_security_registers_info (QSPIFlash *dev) |
| Get the security register layout. | |
Generic QSPI NOR flash driver, used by the part drivers to implement Low-level flash driver.
| status_t qspi_flash_blank_check | ( | QSPIFlash * | dev, |
| uint32_t | addr, | ||
| bool | is_subsector | ||
| ) |
Check whether a sector or subsector is blank.
| dev | Device. |
| addr | Address within the sector or subsector. |
| is_subsector | Check a subsector instead of a sector. |
| bool qspi_flash_check_whoami | ( | QSPIFlash * | dev | ) |
Check the JEDEC ID against the part description.
| dev | Device. |
| status_t qspi_flash_erase_begin | ( | QSPIFlash * | dev, |
| uint32_t | addr, | ||
| bool | is_subsector | ||
| ) |
Start an erase.
| dev | Device. |
| addr | Address of the sector or subsector. |
| is_subsector | Erase a subsector instead of a sector. |
| void qspi_flash_erase_resume | ( | QSPIFlash * | dev, |
| uint32_t | addr | ||
| ) |
Resume a suspended erase.
| dev | Device. |
| addr | Address of the erase. |
| status_t qspi_flash_erase_security_register | ( | QSPIFlash * | dev, |
| uint32_t | addr | ||
| ) |
Erase a security register.
| dev | Device. |
| addr | Security register address. |
| status_t qspi_flash_erase_suspend | ( | QSPIFlash * | dev, |
| uint32_t | addr | ||
| ) |
Suspend an in-progress erase.
| dev | Device. |
| addr | Address of the erase. |
| status_t qspi_flash_get_write_status | ( | QSPIFlash * | dev | ) |
| void qspi_flash_init | ( | QSPIFlash * | dev, |
| QSPIFlashPart * | part, | ||
| bool | coredump_mode | ||
| ) |
Initialize a QSPI flash device.
Resets the part and configures the controller for its read and write modes.
| dev | Device. |
| part | Part description. |
| coredump_mode | Do not rely on OS services, because a core dump is in progress. |
| status_t qspi_flash_is_erase_complete | ( | QSPIFlash * | dev | ) |
Check whether an erase has completed.
| dev | Device. |
| bool qspi_flash_is_in_coredump_mode | ( | QSPIFlash * | dev | ) |
Check whether the device was initialized in core dump mode.
| dev | Device. |
| status_t qspi_flash_lock_sector | ( | QSPIFlash * | dev, |
| uint32_t | addr | ||
| ) |
Lock a sector against writes and erases.
Uses the block_lock instruction, with block_lock.lock_data if block_lock.has_lock_data, and checks block_lock_status against block_lock.locked_check.
| dev | Device. |
| addr | Sector address. |
| void qspi_flash_read_blocking | ( | QSPIFlash * | dev, |
| uint32_t | addr, | ||
| void * | buffer, | ||
| uint32_t | length | ||
| ) |
Read data, blocking.
| dev | Device. | |
| addr | Flash address. | |
| [out] | buffer | Buffer receiving the data. |
| length | Number of bytes to read. |
| status_t qspi_flash_read_security_register | ( | QSPIFlash * | dev, |
| uint32_t | addr, | ||
| uint8_t * | val | ||
| ) |
Read a byte from a security register.
| dev | Device. | |
| addr | Security register address. | |
| [out] | val | Byte read. |
| status_t qspi_flash_security_register_is_locked | ( | QSPIFlash * | dev, |
| uint32_t | address, | ||
| bool * | locked | ||
| ) |
Check whether a security register is locked.
| dev | Device. | |
| address | Security register address. | |
| [out] | locked | true if locked. |
| const FlashSecurityRegisters * qspi_flash_security_registers_info | ( | QSPIFlash * | dev | ) |
Get the security register layout.
| dev | Device. |
| void qspi_flash_set_lower_power_mode | ( | QSPIFlash * | dev, |
| bool | active | ||
| ) |
Enter or leave deep power-down.
| dev | Device. |
| active | true to enter deep power-down. |
| status_t qspi_flash_unlock_all | ( | QSPIFlash * | dev | ) |
Unlock all sectors, with the block_unlock_all instruction.
| dev | Device. |
| int qspi_flash_write_page_begin | ( | QSPIFlash * | dev, |
| const void * | buffer, | ||
| uint32_t | addr, | ||
| uint32_t | length | ||
| ) |
Start writing up to a page.
| dev | Device. |
| buffer | Data to write. |
| addr | Flash address. |
| length | Number of bytes available in buffer. |
| status_t qspi_flash_write_protection_enable | ( | QSPIFlash * | dev | ) |
Enable write and erase protection.
Uses the write_protection_enable instruction and checks the result of read_protection_status against block_lock.protection_enabled_mask.
| dev | Device. |
| status_t qspi_flash_write_security_register | ( | QSPIFlash * | dev, |
| uint32_t | addr, | ||
| uint8_t | val | ||
| ) |
Write a byte to a security register.
| dev | Device. |
| addr | Security register address. |
| val | Byte to write. |