Functions | |
sint8 | m2m_flash_erase_sector (tenuWincFlashRegion enuRegion, uint8 u8StartSector, uint8 u8NumSectors) |
Erase one or more sectors within a WINC flash region. More... | |
sint8 | m2m_flash_read (tenuWincFlashRegion enuRegion, void *pvBuffer, uint32 u32Offset, uint32 u32Size) |
Read the number of bytes specified from a WINC flash location. More... | |
sint8 | m2m_flash_switch_firmware (void) |
Switch the active and inactive firmware images. More... | |
sint8 | m2m_flash_write (tenuWincFlashRegion enuRegion, void *pvBuffer, uint32 u32Offset, uint32 u32Size) |
Write the number of bytes specified to a WINC flash location. More... | |
sint8 m2m_flash_erase_sector | ( | tenuWincFlashRegion | enuRegion, |
uint8 | u8StartSector, | ||
uint8 | u8NumSectors | ||
) |
Erase one or more sectors within a WINC flash region.
[in] | enuRegion | Region of flash in which to erase. |
[in] | u8StartSector | Sector offset (within region) of first sector to erase. |
[in] | u8NumSectors | Number of sectors to erase. |
References find_flash_section(), FLASH_SECTOR_SZ, M2M_ERR_FAIL, M2M_ERR_INVALID_ARG, M2M_SUCCESS, nm_get_state(), NM_STATE_INIT, spi_flash_erase(), and WINC_FLASH_NUM_REGIONS.
sint8 m2m_flash_read | ( | tenuWincFlashRegion | enuRegion, |
void * | pvBuffer, | ||
uint32 | u32Offset, | ||
uint32 | u32Size | ||
) |
Read the number of bytes specified from a WINC flash location.
[in] | enuRegion | Region of flash from which to read. |
[out] | pvBuffer | Pointer to buffer to populate with the data being read. |
[in] | u32Offset | Byte offset (within region) of read location. |
[in] | u32Size | Number of bytes to read. |
References find_flash_section(), M2M_ERR_FAIL, M2M_ERR_INVALID_ARG, M2M_SUCCESS, nm_get_state(), NM_STATE_INIT, NULL, spi_flash_read(), and WINC_FLASH_NUM_REGIONS.
sint8 m2m_flash_switch_firmware | ( | void | ) |
Switch the active and inactive firmware images.
References M2M_ERR_FAIL, M2M_SUCCESS, nm_get_state(), NM_STATE_INIT, OTA_STATUS_INVALID, read_control_structure(), tstrOtaControlSec::u32OtaCurrentWorkingImagOffset, tstrOtaControlSec::u32OtaRollbackImageOffset, tstrOtaControlSec::u32OtaRollbackImageValidStatus, and update_control_structure().
sint8 m2m_flash_write | ( | tenuWincFlashRegion | enuRegion, |
void * | pvBuffer, | ||
uint32 | u32Offset, | ||
uint32 | u32Size | ||
) |
Write the number of bytes specified to a WINC flash location.
[in] | enuRegion | Region of flash in which to write. |
[in] | pvBuffer | Pointer to buffer containing the data to write. |
[in] | u32Offset | Byte offset (within region) of write location. |
[in] | u32Size | Number of bytes to write. |
References find_flash_section(), M2M_ERR_FAIL, M2M_ERR_INVALID_ARG, M2M_SUCCESS, nm_get_state(), NM_STATE_INIT, NULL, spi_flash_write(), and WINC_FLASH_NUM_REGIONS.