Microchip® Advanced Software Framework

nmdrv.c File Reference

This module contains WINC3400 M2M driver APIs implementation.

Copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.

Functions

sint8 nm_cpu_start (void)
 Start CPU from the WINC module. More...
 
sint8 nm_drv_deinit (void *arg)
 
sint8 nm_drv_init (void *arg, uint32 req_serial_number)
 
sint8 nm_drv_init_download_mode (uint32 req_serial_number)
 
sint8 nm_drv_init_hold (uint32 req_serial_number)
 
sint8 nm_drv_init_start (void *arg)
 
sint8 nm_get_firmware_full_info (tstrM2mRev *pstrRev)
 Get Firmware version info. More...
 
sint8 nm_get_hif_info (uint16 *pu16FwHifInfo, uint16 *pu16OtaHifInfo)
 Get Hif info of images in both partitions (Firmware and Ota). More...
 
sint8 nm_get_ota_firmware_info (tstrM2mRev *pstrRev)
 Get Firmware version info. More...
 
tenuNmState nm_get_state (void)
 Get the current state of the WINC module. More...
 

Variables

static tenuNmState genuNmState = NM_STATE_DEINIT
 

nm_cpu_start ( void  )

Start CPU from the WINC module.

Returns
M2M_SUCCESS in case of success and Negative error code in case of failure

References cpu_start().

sint8 nm_drv_init ( void *  arg,
uint32  req_serial_number 
)
sint8 nm_drv_init_download_mode ( uint32  req_serial_number)
nm_get_firmware_full_info ( tstrM2mRev pstrRev)

Get Firmware version info.

Parameters
[out]M2mRevPointer holds address of structure tstrM2mRev that contains the firmware version parameters
[out]pstrRevPointer holds address of structure tstrM2mRev that contains the version parameters of image in the active partition.
Returns
M2M_SUCCESS in case of success and Negative error code in case of failure

References tstrM2mRev::BuildDate, tstrM2mRev::BuildTime, M2M_ERR, M2M_ERR_FAIL, M2M_GET_HIF_BLOCK, M2M_GET_HIF_MAJOR, M2M_GET_HIF_MINOR, M2M_HIF_BLOCK_VALUE, M2M_INFO, m2m_memset(), M2M_SUCCESS, nm_get_hif_info(), nm_read_block(), nm_read_reg_with_ret(), NULL, rNMI_GP_REG_0, tstrM2mRev::u16FirmwareHifInfo, tstrGpRegs::u32Firmware_Ota_rev, tstrM2mRev::u8FirmwareMajor, tstrM2mRev::u8FirmwareMinor, and tstrM2mRev::u8FirmwarePatch.

Referenced by m2m_wifi_get_firmware_version().

nm_get_hif_info ( uint16 pu16FwHifInfo,
uint16 pu16OtaHifInfo 
)

Get Hif info of images in both partitions (Firmware and Ota).

Parameters
[out]pu16FwHifInfoPointer holding Hif info of image in the active partition.
[out]pu16OtaHifInfoPointer holding Hif info of image in the inactive partition.
Returns
M2M_SUCCESS in case of success and Negative error code in case of failure

References M2M_SUCCESS, nm_read_reg_with_ret(), NMI_REV_REG, and NULL.

Referenced by hif_enable_access(), m2m_wifi_check_ota_rb(), nm_get_firmware_full_info(), and nm_get_ota_firmware_info().

nm_get_ota_firmware_info ( tstrM2mRev pstrRev)

Get Firmware version info.

Parameters
[out]M2mRevPointer holds address of structure tstrM2mRev that contains the firmware version parameters
[out]pstrRevPointer holds address of structure tstrM2mRev that contains the version parameters of image in the inactive partition.
Returns
M2M_SUCCESS in case of success and Negative error code in case of failure

References tstrM2mRev::BuildDate, tstrM2mRev::BuildTime, M2M_ERR, M2M_ERR_FAIL, M2M_GET_HIF_BLOCK, M2M_GET_HIF_MAJOR, M2M_GET_HIF_MINOR, M2M_HIF_BLOCK_VALUE, M2M_INFO, m2m_memset(), M2M_SUCCESS, nm_get_hif_info(), nm_read_block(), nm_read_reg_with_ret(), NULL, rNMI_GP_REG_0, tstrM2mRev::u16FirmwareHifInfo, tstrGpRegs::u32Firmware_Ota_rev, tstrM2mRev::u8FirmwareMajor, tstrM2mRev::u8FirmwareMinor, and tstrM2mRev::u8FirmwarePatch.

Referenced by m2m_ota_get_firmware_version().

nm_get_state ( void  )

Get the current state of the WINC module.

Returns
The current state of the WINC module

References genuNmState.

Referenced by find_flash_section(), m2m_flash_erase_sector(), m2m_flash_read(), m2m_flash_switch_firmware(), m2m_flash_write(), and m2m_wifi_get_state().