This module contains NMC1000 bus wrapper APIs implementation.
Copyright (c) 2016-2021 Microchip Technology Inc. and its subsidiaries.
#include <stdio.h>
#include "bsp/include/nm_bsp.h"
#include "common/include/nm_common.h"
#include "bus_wrapper/include/nm_bus_wrapper.h"
#include "asf.h"
#include "conf_winc.h"
Macros | |
#define | NM_BUS_MAX_TRX_SZ 256 |
Functions | |
sint8 | nm_bus_deinit (void) |
De-initialize the bus wrapper. More... | |
sint8 | nm_bus_init (void *pvinit) |
sint8 | nm_bus_ioctl (uint8 u8Cmd, void *pvParameter) |
sint8 | nm_bus_reinit (void *config) |
sint8 | nm_spi_rw (uint8 *pu8Mosi, uint8 *pu8Miso, uint16 u16Sz) |
static sint8 | spi_rw_pio (uint8 *pu8Mosi, uint8 *pu8Miso, uint16 u16Sz) |
Variables | |
tstrNmBusCapabilities | egstrNmBusCapabilities |
struct spi_module | master |
struct spi_slave_inst | slave_inst |
#define NM_BUS_MAX_TRX_SZ 256 |
nm_bus_deinit | ( | void | ) |
De-initialize the bus wrapper.
References CONF_WINC_SPI_MISO, CONF_WINC_SPI_MOSI, CONF_WINC_SPI_SCK, CONF_WINC_SPI_SS, port_config::direction, i2c_master_disable(), port_config::input_pull, M2M_SUCCESS, master, nm_bsp_deinit(), port_get_config_defaults(), PORT_PIN_DIR_INPUT, PORT_PIN_PULL_NONE, port_pin_set_config(), and spi_disable().
Referenced by nm_bus_iface_deinit().
sint8 nm_bus_init | ( | void * | pvinit | ) |
References spi_master_config::baudrate, i2c_master_config::buffer_timeout, CONF_WINC_SPI_CLOCK, CONF_WINC_SPI_CS_PIN, CONF_WINC_SPI_MODULE, CONF_WINC_SPI_PINMUX_PAD0, CONF_WINC_SPI_PINMUX_PAD1, CONF_WINC_SPI_PINMUX_PAD2, CONF_WINC_SPI_PINMUX_PAD3, CONF_WINC_SPI_SERCOM_MUX, i2c_master_enable(), i2c_master_get_config_defaults(), i2c_master_init(), M2M_ERR_BUS_FAIL, M2M_SUCCESS, master, spi_config::master, spi_config::mode_specific, spi_config::mux_setting, nm_bsp_reset(), nm_bsp_sleep(), spi_config::pinmux_pad0, spi_config::pinmux_pad1, spi_config::pinmux_pad2, spi_config::pinmux_pad3, slave_inst, spi_attach_slave(), spi_enable(), spi_get_config_defaults(), spi_init(), spi_slave_inst_get_config_defaults(), spi_slave_inst_config::ss_pin, and STATUS_OK.
Referenced by nm_bus_iface_init().
References M2M_ERR, NM_BUS_IOCTL_R, NM_BUS_IOCTL_RW, NM_BUS_IOCTL_W, NM_BUS_IOCTL_W_SPECIAL, nm_spi_rw(), tstrNmI2cDefault::pu8Buf, tstrNmI2cSpecial::pu8Buf1, tstrNmI2cSpecial::pu8Buf2, tstrNmSpiRw::pu8InBuf, tstrNmSpiRw::pu8OutBuf, tstrNmI2cDefault::u16Sz, tstrNmSpiRw::u16Sz, tstrNmI2cSpecial::u16Sz1, and tstrNmI2cSpecial::u16Sz2.
sint8 nm_bus_reinit | ( | void * | config | ) |
References M2M_SUCCESS.
References spi_rw_pio().
Referenced by nm_bus_ioctl(), nmi_spi_read(), nmi_spi_write(), and nmi_spi_writeread().
References M2M_ERR_BUS_FAIL, M2M_ERR_INVALID_ARG, M2M_SUCCESS, master, NULL, slave_inst, spi_is_ready_to_read(), spi_is_ready_to_write(), spi_is_write_complete(), spi_read(), spi_select_slave(), spi_write(), and STATUS_OK.
Referenced by nm_spi_rw().
tstrNmBusCapabilities egstrNmBusCapabilities |
Referenced by nm_read_block(), and nm_write_block().
struct spi_module master |
Referenced by nm_bus_deinit(), nm_bus_init(), and spi_rw_pio().
struct spi_slave_inst slave_inst |
Referenced by nm_bus_init(), and spi_rw_pio().