Embed: (wiki syntax)

« Back to documentation index

zg_com.h File Reference

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 , 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 LPC2368/drv/zg2100/zg_com.h.


Typedef Documentation

typedef enum __ZG_SPI_DIR ZG_SPI_DIR

SPI transfers directions.


Enumeration Type Documentation

SPI transfers directions.

Enumerator:
ZG_SPI_WRITE 

Read.

ZG_SPI_TRF 

Write.

Read & Write

ZG_SPI_WRITE 

Read.

ZG_SPI_TRF 

Write.

Read & Write

Definition at line 77 of file LPC2368/drv/zg2100/zg_com.h.


Function Documentation

void zg_com_init ( SPI *  pSpi,
DigitalOut *  pCs,
DigitalIn *  pInt,
DigitalOut *  pNrst 
)

Opens SPI interface with pins.

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)

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

bool zg_is_int (  )

Is there an interrupt to serve?

uint32_t zg_register_read ( uint32_t  addr )

Reads register.

void zg_register_write ( uint32_t  addr,
uint32_t  reg 
)

Writes register.

void zg_spi_trf ( byte *  buf,
int  len,
bool  resetCs = true,
ZG_SPI_DIR  dir = ZG_SPI_TRF 
)

Transfers SPI frame.