SDK3.5
This document shows Ameba SDK 3.5 APIs
Data Structures | Enumerator | Variables
SPDIO

spdio functions More...

Data Structures

struct  spdio_buf_t
 
struct  spdio_t
 

Variables

void * priv
 
u32 buf_allocated
 
u16 size_allocated
 
u32 buf_addr
 
u16 buf_size
 
u8 type
 
u8 reserved
 
void * priv
 
u32 tx_bd_num
 
u32 rx_bd_num
 
u32 rx_bd_bufsz
 
struct spdio_buf_trx_buf
 
char(* rx_done_cb )(void *priv, void *pbuf, u8 *pdata, u16 size, u8 type)
 pointer to callback function defined by user, called by spdio when one packet receive done More...
 
char(* tx_done_cb )(void *priv, void *pbuf)
 pointer to callback function defined by user, called by spdio when one packet sent done More...
 

Ameba Common

enum  spdio_rx_data_t { SPDIO_RX_DATA_NULL = 0x00, SPDIO_RX_DATA_ETH = 0x83, SPDIO_RX_DATA_ATCMD = 0x11, SPDIO_RX_DATA_USER = 0x41 }
 
enum  spdio_tx_data_t { SPDIO_TX_DATA_NULL = 0x00, SPDIO_TX_DATA_ETH = 0x82, SPDIO_TX_DATA_ATCMDRSP = 0x10, SPDIO_TX_DATA_USER = 0x40 }
 
struct spdio_tg_spdio_priv
 an obj which will be used to initialize sdio interface so it must be initialized before calling HalSdioInit();
 
void spdio_structinit (struct spdio_t *obj)
 Gets example setting for spdio obj. More...
 
void spdio_init (struct spdio_t *obj)
 Initialize spdio interface. More...
 
void spdio_deinit (struct spdio_t *obj)
 Deinitialize spdio interface. More...
 
s8 spdio_tx (struct spdio_t *obj, struct spdio_buf_t *pbuf)
 spdio write function. More...
 

Detailed Description

spdio functions

Function Documentation

void spdio_deinit ( struct spdio_t obj)

Deinitialize spdio interface.

Parameters
obja pointer to spdio_t structure which is already initialized
Return values
None
void spdio_init ( struct spdio_t obj)

Initialize spdio interface.

Parameters
obj,apointer to a spdio_t structure which should be initialized by user, and which will be used to initialize spdio interface obj->tx_bd_num: spdio write bd number, needs 2 bd for one transaction obj->rx_bd_num: spdio read bd number obj->rx_bd_bufsz: spdio read buffer size obj->rx_buf: spdio read buffer array
Return values
None
void spdio_structinit ( struct spdio_t obj)

Gets example setting for spdio obj.

Parameters
obja pointer to an spdio_t structure which will be initialized with an example settings
Return values
None
s8 spdio_tx ( struct spdio_t obj,
struct spdio_buf_t pbuf 
)

spdio write function.

Parameters
obja pointer to spdio_t structure which is already initialized
pbufa pointer to spdio_buf_t structure which carries the payload
Return values
SUCCESSor FAIL

Variable Documentation

char(* rx_done_cb) (void *priv, void *pbuf, u8 *pdata, u16 size, u8 type)

pointer to callback function defined by user, called by spdio when one packet receive done

Parameters
priva pointer to spdio_t structure which is used to initilize spdio interface
pbufa pointer to spdio_buf_t structure which is spdio receive buffer
pdatathe actual received packet payload
sizethe actual payload length
typethe received packet type, spdio_rx_data_t
Return values
SUCCESSor FAIL
char(* tx_done_cb) (void *priv, void *pbuf)

pointer to callback function defined by user, called by spdio when one packet sent done

Parameters
priva pointer to spdio_t structure which is used to initilize spdio interface
pbufa pointer to spdio_buf_t structure which carries the transmit packet
Return values
SUCCESSor FAIL