This module contains WILC SDIO protocol bus APIs implementation.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
#include "common/include/nm_common.h"
#include "bus_wrapper/include/nm_bus_wrapper.h"
#include "nmsdio.h"
Macros | |
#define | N_FAIL 0 |
#define | N_OK 1 |
#define | N_RESET -1 |
#define | N_RETRY -2 |
#define | NMI_INTR_ENABLE (NMI_INTR_REG_BASE) |
#define | NMI_INTR_REG_BASE (NMI_PERIPH_REG_BASE+0xa00) |
#define | NMI_PERIPH_REG_BASE 0x1000 |
#define | NMI_PIN_MUX_0 (NMI_PERIPH_REG_BASE + 0x408) |
#define | SDIO_ALGN_USE_STATIC_BUFFER |
#define | WILC_SDIO_BLOCK_SIZE 512 |
Functions | |
sint8 | nm_sdio_deinit (void) |
sint8 | nm_sdio_init (void) |
Initialize the SDIO. More... | |
sint8 | nm_sdio_read_block (uint32 u32Addr, uint8 *puBuf, uint16 u16Sz) |
uint32 | nm_sdio_read_reg (uint32 u32Addr) |
sint8 | nm_sdio_read_reg_with_ret (uint32 u32Addr, uint32 *pu32RetVal) |
sint8 | nm_sdio_write_block (uint32 u32Addr, uint8 *puBuf, uint16 u16Sz) |
sint8 | nm_sdio_write_reg (uint32 u32Addr, uint32 u32Val) |
static int | sdio_int_enable (void) |
static int | sdio_read (uint32_t addr, uint8_t *buf, uint32_t size) |
static int | sdio_read_reg (uint32_t addr, uint32_t *data) |
static int | sdio_set_func0_block_size (uint32_t block_size) |
static int | sdio_set_func0_csa_address (uint32_t adr) |
static int | sdio_set_func1_block_size (uint32_t block_size) |
static int | sdio_write (uint32_t addr, uint8_t *buf, uint32_t size) |
static int | sdio_write_reg (uint32_t addr, uint32_t data) |
#define N_FAIL 0 |
#define N_OK 1 |
#define N_RESET -1 |
#define N_RETRY -2 |
#define NMI_INTR_ENABLE (NMI_INTR_REG_BASE) |
Referenced by sdio_int_enable().
#define NMI_INTR_REG_BASE (NMI_PERIPH_REG_BASE+0xa00) |
#define NMI_PERIPH_REG_BASE 0x1000 |
#define NMI_PIN_MUX_0 (NMI_PERIPH_REG_BASE + 0x408) |
Referenced by sdio_int_enable().
#define SDIO_ALGN_USE_STATIC_BUFFER |
#define WILC_SDIO_BLOCK_SIZE 512 |
Referenced by nm_sdio_init(), sdio_read(), sdio_read_reg(), sdio_write(), and sdio_write_reg().
References M2M_SUCCESS.
Referenced by nm_drv_init().
nm_sdio_init | ( | void | ) |
Initialize the SDIO.
References tstrNmSdioCmd52::address, tstrNmSdioCmd52::data, tstrNmSdioCmd52::function, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_ERR_INIT, M2M_SUCCESS, nm_bus_ioctl(), NM_BUS_IOCTL_CMD_52, tstrNmSdioCmd52::raw, tstrNmSdioCmd52::read_write, sdio_int_enable(), sdio_set_func0_block_size(), sdio_set_func1_block_size(), and WILC_SDIO_BLOCK_SIZE.
Referenced by nm_drv_deinit(), and nm_drv_init().
References sdio_read().
Referenced by p_nm_read_block().
References sdio_read_reg().
Referenced by nm_read_reg().
References sdio_read_reg().
Referenced by nm_read_reg_with_ret().
References sdio_write().
Referenced by p_nm_write_block().
References sdio_write_reg().
Referenced by nm_write_reg().
|
static |
interrupt pin mux select
interrupt enable
References M2M_ERR, M2M_ERR_INIT, M2M_SUCCESS, NMI_INTR_ENABLE, NMI_PIN_MUX_0, sdio_read_reg(), and sdio_write_reg().
Referenced by nm_sdio_init().
|
static |
References tstrNmSdioCmd53::address, tstrNmSdioCmd53::block_mode, tstrNmSdioCmd53::block_size, tstrNmSdioCmd53::buffer, tstrNmSdioCmd53::count, tstrNmSdioCmd53::function, tstrNmSdioCmd53::increment, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_SUCCESS, nm_bus_ioctl(), NM_BUS_IOCTL_CMD_53, tstrNmSdioCmd53::read_write, sdio_set_func0_csa_address(), and WILC_SDIO_BLOCK_SIZE.
Referenced by nm_sdio_read_block().
|
static |
References tstrNmSdioCmd52::address, tstrNmSdioCmd53::address, tstrNmSdioCmd53::block_mode, tstrNmSdioCmd53::block_size, tstrNmSdioCmd53::buffer, tstrNmSdioCmd53::count, tstrNmSdioCmd52::data, tstrNmSdioCmd52::function, tstrNmSdioCmd53::function, tstrNmSdioCmd53::increment, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_SUCCESS, nm_bus_ioctl(), NM_BUS_IOCTL_CMD_52, NM_BUS_IOCTL_CMD_53, tstrNmSdioCmd52::raw, tstrNmSdioCmd52::read_write, tstrNmSdioCmd53::read_write, sdio_set_func0_csa_address(), and WILC_SDIO_BLOCK_SIZE.
Referenced by nm_sdio_read_reg(), nm_sdio_read_reg_with_ret(), and sdio_int_enable().
|
static |
References tstrNmSdioCmd52::address, tstrNmSdioCmd52::data, tstrNmSdioCmd52::function, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_SUCCESS, nm_bus_ioctl(), NM_BUS_IOCTL_CMD_52, tstrNmSdioCmd52::raw, and tstrNmSdioCmd52::read_write.
Referenced by nm_sdio_init().
|
static |
Review: BIG ENDIAN
References tstrNmSdioCmd52::address, tstrNmSdioCmd52::data, tstrNmSdioCmd52::function, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_SUCCESS, nm_bus_ioctl(), NM_BUS_IOCTL_CMD_52, tstrNmSdioCmd52::raw, and tstrNmSdioCmd52::read_write.
Referenced by sdio_read(), sdio_read_reg(), sdio_write(), and sdio_write_reg().
|
static |
References tstrNmSdioCmd52::address, tstrNmSdioCmd52::data, tstrNmSdioCmd52::function, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_SUCCESS, nm_bus_ioctl(), NM_BUS_IOCTL_CMD_52, tstrNmSdioCmd52::raw, and tstrNmSdioCmd52::read_write.
Referenced by nm_sdio_init().
|
static |
References tstrNmSdioCmd53::address, tstrNmSdioCmd53::block_mode, tstrNmSdioCmd53::block_size, tstrNmSdioCmd53::buffer, tstrNmSdioCmd53::count, tstrNmSdioCmd53::function, tstrNmSdioCmd53::increment, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_SUCCESS, nm_bus_ioctl(), NM_BUS_IOCTL_CMD_53, tstrNmSdioCmd53::read_write, sdio_set_func0_csa_address(), and WILC_SDIO_BLOCK_SIZE.
Referenced by nm_sdio_write_block().
|
static |
set the AHB address
References tstrNmSdioCmd52::address, tstrNmSdioCmd53::address, tstrNmSdioCmd53::block_mode, tstrNmSdioCmd53::block_size, tstrNmSdioCmd53::buffer, tstrNmSdioCmd53::count, tstrNmSdioCmd52::data, tstrNmSdioCmd52::function, tstrNmSdioCmd53::function, tstrNmSdioCmd53::increment, M2M_ERR, M2M_ERR_BUS_FAIL, M2M_SUCCESS, nm_bus_ioctl(), NM_BUS_IOCTL_CMD_52, NM_BUS_IOCTL_CMD_53, tstrNmSdioCmd52::raw, tstrNmSdioCmd52::read_write, tstrNmSdioCmd53::read_write, sdio_set_func0_csa_address(), and WILC_SDIO_BLOCK_SIZE.
Referenced by nm_sdio_write_reg(), and sdio_int_enable().