This module contains NMC1000 SPI protocol bus APIs implementation.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
#include "common/include/nm_common.h"
Functions | |
sint8 | nm_spi_deinit (void) |
DeInitialize the SPI. More... | |
sint8 | nm_spi_init (void) |
Initialize the SPI. More... | |
sint8 | nm_spi_read_block (uint32 u32Addr, uint8 *puBuf, uint16 u16Sz) |
uint32 | nm_spi_read_reg (uint32 u32Addr) |
sint8 | nm_spi_read_reg_with_ret (uint32 u32Addr, uint32 *pu32RetVal) |
sint8 | nm_spi_reset (void) |
reset the SPI More... | |
sint8 | nm_spi_write_block (uint32 u32Addr, uint8 *puBuf, uint16 u16Sz) |
sint8 | nm_spi_write_reg (uint32 u32Addr, uint32 u32Val) |
sint8 nm_spi_deinit | ( | void | ) |
DeInitialize the SPI.
References gu8Crc_off, and M2M_SUCCESS.
Referenced by nm_drv_deinit(), and nm_drv_init_start().
sint8 nm_spi_init | ( | void | ) |
Initialize the SPI.
DeInitialize the SPI.
configure protocol
make sure can read back chip id correctly
References gu8Crc_off, M2M_DBG, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_SUCCESS, nm_spi_read_reg_with_ret(), nm_spi_write_reg(), NMI_SPI_PROTOCOL_CONFIG, and spi_init_pkt_sz().
Referenced by nm_drv_init_download_mode(), and nm_drv_init_hold().
References M2M_ERR_BUS_FAIL, M2M_SUCCESS, N_OK, and nm_spi_read().
Referenced by p_nm_read_block().
References nm_spi_read_reg_with_ret().
Referenced by nm_read_reg(), and spi_init_pkt_sz().
NMC1000 clockless registers.
References CMD_INTERNAL_READ, CMD_RESET, CMD_SINGLE_READ, M2M_ERR, N_OK, nm_bsp_sleep(), spi_cmd(), spi_cmd_rsp(), spi_data_read(), and SPI_RETRY_COUNT.
Referenced by nm_read_reg_with_ret(), nm_spi_init(), and nm_spi_read_reg().
sint8 nm_spi_reset | ( | void | ) |
reset the SPI
References CMD_RESET, M2M_ERR, N_FAIL, N_OK, nmi_spi_writeread(), spi_cmd(), and spi_cmd_rsp().
Referenced by nm_bus_reset().
References M2M_ERR_BUS_FAIL, M2M_SUCCESS, N_OK, and nm_spi_write().
Referenced by p_nm_write_block().
NMC1000 clockless registers.
References CMD_INTERNAL_WRITE, CMD_RESET, CMD_SINGLE_WRITE, M2M_ERR, N_OK, nm_bsp_sleep(), spi_cmd(), spi_cmd_rsp(), and SPI_RETRY_COUNT.
Referenced by nm_spi_init(), nm_write_reg(), and spi_init_pkt_sz().