ZG2100 Network interface source
« Back to documentation index
zg_com.h File Reference
ZG2100 Low-level communication functions (SPI, CS, Interrupt)
More...
Go to the source code of this file.
Typedefs
typedef enum __ZG_SPI_DIR ZG_SPI_DIR
SPI transfers directions.
Enumerations
enum __ZG_SPI_DIR { , ZG_SPI_WRITE ,
ZG_SPI_TRF
}
SPI transfers directions.
More...
Functions
void zg_com_init (SPI *pSpi, DigitalOut *pCs, DigitalIn *pInt, DigitalOut *pNrst)
Opens SPI interface with pins.
uint32_t zg_register_read (uint32_t addr)
Reads register.
void zg_register_write (uint32_t addr, uint32_t reg)
Writes register.
uint32_t zg_indexed_register_read (uint32_t addr)
Reads indexed register.
void zg_indexed_register_write (uint32_t addr, uint32_t reg)
writes indexed register
void zg_fifo_read (byte fifo, byte *pType, byte *pSubtype, byte *buf, int len)
Reads FIFO.
void zg_fifo_write (byte fifo, byte type, byte subtype, byte *buf, int len, bool start=true, bool stop=true)
Writes FIFO (can be chunked)
void zg_spi_trf (byte *buf, int len, bool resetCs=true, ZG_SPI_DIR dir=ZG_SPI_TRF)
Transfers SPI frame.
bool zg_is_int ()
Is there an interrupt to serve?
Detailed Description
ZG2100 Low-level communication functions (SPI, CS, Interrupt)
Definition in file zg_com.h .
Typedef Documentation
SPI transfers directions.
Enumeration Type Documentation
SPI transfers directions.
Enumerator:
ZG_SPI_WRITE
Read.
ZG_SPI_TRF
Write.
Read & Write
Definition at line 77 of file zg_com.h .
Function Documentation
void zg_com_init
(
SPI *
pSpi ,
DigitalOut *
pCs ,
DigitalIn *
pInt ,
DigitalOut *
pNrst
)
Opens SPI interface with pins.
Definition at line 47 of file zg_com.c .
void zg_fifo_read
(
byte
fifo ,
byte *
pType ,
byte *
pSubtype ,
byte *
buf ,
int
len
)
void zg_fifo_write
(
byte
fifo ,
byte
type ,
byte
subtype ,
byte *
buf ,
int
len ,
bool
start = true
,
bool
stop = true
)
Writes FIFO (can be chunked)
Definition at line 140 of file zg_com.c .
uint32_t zg_indexed_register_read
(
uint32_t
addr )
Reads indexed register.
Definition at line 111 of file zg_com.c .
void zg_indexed_register_write
(
uint32_t
addr ,
uint32_t
reg
)
writes indexed register
Definition at line 117 of file zg_com.c .
Is there an interrupt to serve?
Definition at line 208 of file zg_com.c .
uint32_t zg_register_read
(
uint32_t
addr )
Reads register.
Definition at line 67 of file zg_com.c .
void zg_register_write
(
uint32_t
addr ,
uint32_t
reg
)
Writes register.
Definition at line 90 of file zg_com.c .
void zg_spi_trf
(
byte *
buf ,
int
len ,
bool
resetCs = true
,
ZG_SPI_DIR
dir = ZG_SPI_TRF
)
Transfers SPI frame.
Definition at line 163 of file zg_com.c .