This module contains WINC3400 bus wrapper APIs declarations.
Copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.
#include "common/include/nm_common.h"
Data Structures | |
struct | tstrNmBusCapabilities |
Structure holding bus capabilities information. More... | |
struct | tstrNmI2cDefault |
Structure holding I2C default operation parameters. More... | |
struct | tstrNmI2cSpecial |
Structure holding I2C special operation parameters. More... | |
struct | tstrNmSpiRw |
Structure holding SPI R/W parameters. More... | |
struct | tstrNmUartDefault |
Structure holding UART default operation parameters. More... | |
Macros | |
#define | NM_BUS_IOCTL_R ((uint8)0) |
IOCTL commands. More... | |
#define | NM_BUS_IOCTL_RW ((uint8)3) |
#define | NM_BUS_IOCTL_W ((uint8)1) |
#define | NM_BUS_IOCTL_W_SPECIAL ((uint8)2) |
#define | NM_BUS_IOCTL_WR_RESTART ((uint8)4) |
#define | NM_BUS_TYPE_I2C ((uint8)0) |
BUS Type. More... | |
#define | NM_BUS_TYPE_SPI ((uint8)1) |
#define | NM_BUS_TYPE_UART ((uint8)2) |
Functions | |
sint8 | nm_bus_deinit (void) |
De-initialize the bus wrapper. More... | |
sint8 | nm_bus_init (uint8 *req_com_port, uint32 req_serial_number) |
sint8 | nm_bus_ioctl (uint8 u8Cmd, void *pvParameter) |
sint8 | nm_bus_reinit (void *) |
sint8 | nm_spi_rw (uint8 *pu8Mosi, uint8 *pu8Miso, uint16 u16Sz) |
sint8 | spi_xdmac_init () |
Variables | |
tstrNmBusCapabilities | egstrNmBusCapabilities |
#define NM_BUS_IOCTL_R ((uint8)0) |
IOCTL commands.
Read only ==> I2C/UART. Parameter:tstrNmI2cDefault/tstrNmUartDefault
Referenced by nm_bus_ioctl().
#define NM_BUS_IOCTL_RW ((uint8)3) |
Read/Write at the same time ==> SPI only. Parameter:tstrNmSpiRw
Referenced by nm_bus_ioctl(), nmi_spi_read(), and nmi_spi_write().
#define NM_BUS_IOCTL_W ((uint8)1) |
Write only ==> I2C/UART. Parameter type tstrNmI2cDefault/tstrNmUartDefault
Referenced by nm_bus_ioctl().
#define NM_BUS_IOCTL_W_SPECIAL ((uint8)2) |
Write two buffers within the same transaction (same start/stop conditions) ==> I2C only. Parameter:tstrNmI2cSpecial
Referenced by nm_bus_ioctl().
#define NM_BUS_IOCTL_WR_RESTART ((uint8)4) |
Write buffer then made restart condition then read ==> I2C only. parameter:tstrNmI2cSpecial
#define NM_BUS_TYPE_I2C ((uint8)0) |
BUS Type.
#define NM_BUS_TYPE_SPI ((uint8)1) |
#define NM_BUS_TYPE_UART ((uint8)2) |
sint8 nm_bus_deinit | ( | void | ) |
De-initialize the bus wrapper.
References CONF_WINC_SPI, CONF_WINC_SPI_CLK_GPIO, CONF_WINC_SPI_CS_GPIO, CONF_WINC_SPI_MISO_GPIO, CONF_WINC_SPI_MOSI_GPIO, IOPORT_DIR_INPUT, ioport_set_pin_dir(), M2M_SUCCESS, and spi_disable().
Referenced by nm_bus_iface_deinit().
References M2M_ERR, NM_BUS_IOCTL_R, NM_BUS_IOCTL_RW, NM_BUS_IOCTL_W, NM_BUS_IOCTL_W_SPECIAL, tstrNmI2cDefault::pu8Buf, tstrNmI2cSpecial::pu8Buf1, tstrNmI2cSpecial::pu8Buf2, tstrNmSpiRw::pu8InBuf, tstrNmSpiRw::pu8OutBuf, spi_rw(), spi_xdmac_configure(), tstrNmI2cDefault::u16Sz, tstrNmSpiRw::u16Sz, tstrNmI2cSpecial::u16Sz1, and tstrNmI2cSpecial::u16Sz2.
Referenced by nmi_spi_read(), and nmi_spi_write().
sint8 nm_bus_reinit | ( | void * | ) |
sint8 spi_xdmac_init | ( | ) |
References CONF_WINC_SPI, xdmac_channel_config_t::mbr_bc, xdmac_channel_config_t::mbr_cfg, xdmac_channel_config_t::mbr_da, xdmac_channel_config_t::mbr_ds, xdmac_channel_config_t::mbr_dus, xdmac_channel_config_t::mbr_sa, xdmac_channel_config_t::mbr_sus, pmc_enable_periph_clk(), SPI0_XDMAC_RX_CH_NUM, SPI0_XDMAC_TX_CH_NUM, xdmac_channel_enable_interrupt(), xdmac_channel_set_descriptor_control(), xdmac_enable_interrupt(), XDMAC_RX_CH, and XDMAC_TX_CH.
Referenced by main().
tstrNmBusCapabilities egstrNmBusCapabilities |
Referenced by nm_read_block(), and nm_write_block().