Functions | |
sint8 | spi_flash_erase (uint32 u32Offset, uint32 u32Sz) |
Erase a specified portion of SPI Flash. . More... | |
uint32 | spi_flash_get_size (void) |
Get size of SPI Flash. More... | |
sint8 | spi_flash_read (uint8 *pu8Buf, uint32 u32Addr, uint32 u32Sz) |
Read a specified portion of data from SPI Flash. . More... | |
sint8 | spi_flash_write (uint8 *pu8Buf, uint32 u32Offset, uint32 u32Sz) |
Write a specified portion of data to SPI Flash. . More... | |
Erase a specified portion of SPI Flash.
.
[in] | u32Offset | Address (Offset) to erase from the SPI flash. |
[in] | u32Sz | Total number of bytes required to be erased. |
References FLASH_PAGE_SZ, M2M_DBG, M2M_ERR_FAIL, M2M_PRINT, M2M_SUCCESS, MAX_ATTEMPT_STATUS_READ, MAX_PROG_CNT, MAX_RETRY, spi_flash_read_status_reg(), spi_flash_sector_erase(), and spi_flash_write_enable().
Referenced by m2m_flash_erase_sector(), and update_control_structure().
uint32 spi_flash_get_size | ( | void | ) |
Get size of SPI Flash.
Returns with uint32 value which is total flash size
.
References M2M_ERR, M2M_INFO, and spi_flash_rdid().
Referenced by find_flash_section().
Read a specified portion of data from SPI Flash.
.
[out] | pu8Buf | Pointer to data buffer which will be filled with data in case of successful operation. |
[in] | u32Addr | Address (Offset) to read from at the SPI flash. |
[in] | u32Sz | Total size of data to be read in bytes |
References FLASH_BLOCK_SIZE, M2M_SUCCESS, and spi_flash_read_internal().
Referenced by m2m_flash_read(), read_control_structure(), and winc_flash_compare().
Write a specified portion of data to SPI Flash.
.
[in] | pu8Buf | Pointer to data buffer which contains the data to be written. |
[in] | u32Offset | Address (Offset) to write at the SPI flash. |
[in] | u32Sz | Total number of size of data bytes |
References BSP_MIN, FLASH_PAGE_SZ, M2M_ERR, M2M_ERR_FAIL, M2M_PRINT, M2M_SUCCESS, and spi_flash_pp().
Referenced by m2m_flash_write(), and winc_flash_write_verify().