This module contains NMC1000 M2M driver APIs implementation.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
#include "common/include/nm_common.h"
#include "driver/source/nmbus.h"
#include "bsp/include/nm_bsp.h"
#include "driver/source/nmdrv.h"
#include "driver/source/nmasic.h"
#include "driver/include/m2m_types.h"
#include "spi_flash/include/spi_flash.h"
Functions | |
sint8 | nm_drv_deinit (void *arg) |
sint8 | nm_drv_init (void *arg) |
sint8 | nm_drv_init_download_mode (void) |
Initialize NMC1000 driver in download mode. More... | |
sint8 | nm_drv_init_hold (void) |
First part of nm_drv_init, up to the point of initializing spi for flash access. More... | |
sint8 | nm_drv_init_start (void *arg) |
sint8 | nm_get_firmware_full_info (tstrM2mRev *pstrRev) |
Get Firmware version info. More... | |
sint8 | nm_get_firmware_info (tstrM2mRev *M2mRev) |
Get Firmware version info. More... | |
sint8 | nm_get_ota_firmware_info (tstrM2mRev *pstrRev) |
Get Firmware version info. More... | |
sint8 nm_drv_deinit | ( | void * | arg | ) |
References chip_deinit(), genuNmState, M2M_ERR, M2M_SUCCESS, nm_bus_iface_deinit(), nm_spi_deinit(), NM_STATE_DEINIT, and spi_flash_enable().
sint8 nm_drv_init | ( | void * | arg | ) |
References M2M_SUCCESS, nm_drv_init_hold(), and nm_drv_init_start().
nm_drv_init_download_mode | ( | void | ) |
Initialize NMC1000 driver in download mode.
[in] | req_serial_number | Chip serial number |
TODO:reset the chip and halt the cpu in case of no wait efuse is set (add the no wait effuse check)
References chip_reset_and_cpu_halt(), GET_CHIPID, ISNMC3000, M2M_ERR, M2M_INFO, M2M_SUCCESS, nm_bus_iface_init(), nm_spi_init(), nm_write_reg(), nmi_get_chipid(), and NULL.
nm_drv_init_hold | ( | void | ) |
First part of nm_drv_init, up to the point of initializing spi for flash access.
[in] | req_serial_number | Parameter inherited from nm_drv_init |
References chip_reset(), chip_wake(), M2M_ERR, M2M_INFO, M2M_SUCCESS, nm_bus_iface_deinit(), nm_bus_iface_init(), nm_spi_init(), nmi_get_chipid(), and NULL.
sint8 nm_drv_init_start | ( | void * | arg | ) |
References cpu_start(), enable_interrupts(), genuNmState, M2M_ERR, M2M_SUCCESS, M2M_WIFI_MODE_ATE_HIGH, M2M_WIFI_MODE_ATE_LOW, M2M_WIFI_MODE_CONFIG, M2M_WIFI_MODE_MAX, M2M_WIFI_MODE_NORMAL, nm_bus_iface_deinit(), nm_spi_deinit(), NM_STATE_START, NULL, wait_for_bootrom(), and wait_for_firmware_start().
sint8 nm_get_firmware_full_info | ( | tstrM2mRev * | pstrRev | ) |
Get Firmware version info.
[out] | M2mRev | Pointer holds address of structure tstrM2mRev that contains the firmware version parameters |
[out] | pstrRev | Pointer holds address of structure tstrM2mRev that contains the version parameters of image in the active partition. |
[out] | M2mRev | pointer holds address of structure "tstrM2mRev" that contains the firmware version parameters |
References tstrM2mRev::BuildDate, tstrM2mRev::BuildTime, M2M_ERR, M2M_ERR_FAIL, M2M_ERR_FW_VER_MISMATCH, M2M_GET_HIF_BLOCK, M2M_GET_HIF_MAJOR, M2M_GET_HIF_MINOR, M2M_HIF_BLOCK_VALUE, M2M_INFO, M2M_MAKE_VERSION, m2m_memset(), M2M_RELEASE_VERSION_MAJOR_NO, M2M_RELEASE_VERSION_MINOR_NO, M2M_RELEASE_VERSION_PATCH_NO, M2M_SUCCESS, nm_get_hif_info(), nm_read_block(), nm_read_reg_with_ret(), NULL, rNMI_GP_REG_0, rNMI_GP_REG_2, tstrM2mRev::u16FirmwareHifInfo, tstrGpRegs::u32Firmware_Ota_rev, tstrM2mRev::u8DriverMajor, tstrM2mRev::u8DriverMinor, tstrM2mRev::u8DriverPatch, tstrM2mRev::u8FirmwareMajor, tstrM2mRev::u8FirmwareMinor, and tstrM2mRev::u8FirmwarePatch.
nm_get_firmware_info | ( | tstrM2mRev * | M2mRev | ) |
Get Firmware version info.
[out] | M2mRev | pointer holds address of structure "tstrM2mRev" that contains the firmware version parameters |
References M2M_ATE_FW_IS_UP_VALUE, M2M_ERR_FW_VER_MISMATCH, M2M_GET_DRV_MAJOR, M2M_GET_DRV_MINOR, M2M_GET_DRV_PATCH, M2M_GET_FW_MAJOR, M2M_GET_FW_MINOR, M2M_GET_FW_PATCH, M2M_MAKE_VERSION, M2M_RELEASE_VERSION_MAJOR_NO, M2M_RELEASE_VERSION_MINOR_NO, M2M_RELEASE_VERSION_PATCH_NO, M2M_SUCCESS, nm_read_reg_with_ret(), nmi_get_chipid(), NMI_REV_REG, NMI_REV_REG_ATE, tstrM2mRev::u16FirmwareSvnNum, tstrM2mRev::u32Chipid, tstrM2mRev::u8DriverMajor, tstrM2mRev::u8DriverMinor, tstrM2mRev::u8DriverPatch, tstrM2mRev::u8FirmwareMajor, tstrM2mRev::u8FirmwareMinor, and tstrM2mRev::u8FirmwarePatch.
sint8 nm_get_ota_firmware_info | ( | tstrM2mRev * | pstrRev | ) |
Get Firmware version info.
[out] | M2mRev | Pointer holds address of structure tstrM2mRev that contains the firmware version parameters |
[out] | pstrRev | Pointer holds address of structure tstrM2mRev that contains the version parameters of image in the inactive partition. |
[out] | M2mRev | pointer holds address of structure "tstrM2mRev" that contains the firmware version parameters |
References tstrM2mRev::BuildDate, tstrM2mRev::BuildTime, M2M_ERR, M2M_ERR_FAIL, M2M_ERR_FW_VER_MISMATCH, M2M_ERR_INVALID, M2M_ERR_INVALID_ARG, M2M_GET_HIF_BLOCK, M2M_GET_HIF_MAJOR, M2M_GET_HIF_MINOR, M2M_HIF_BLOCK_VALUE, M2M_INFO, M2M_MAKE_VERSION, m2m_memset(), M2M_RELEASE_VERSION_MAJOR_NO, M2M_RELEASE_VERSION_MINOR_NO, M2M_RELEASE_VERSION_PATCH_NO, M2M_SUCCESS, nm_get_hif_info(), nm_read_block(), nm_read_reg_with_ret(), NULL, rNMI_GP_REG_0, rNMI_GP_REG_2, tstrM2mRev::u16FirmwareHifInfo, tstrGpRegs::u32Firmware_Ota_rev, tstrM2mRev::u8DriverMajor, tstrM2mRev::u8DriverMinor, tstrM2mRev::u8DriverPatch, tstrM2mRev::u8FirmwareMajor, tstrM2mRev::u8FirmwareMinor, and tstrM2mRev::u8FirmwarePatch.