James Reynolds / AD594x Driver
Embed: (wiki syntax)

« Back to documentation index

SPI_Block_Functions

SPI_Block_Functions
[SPI_Block]

The basic SPI protocols. More...

Functions

static unsigned char AD5940_ReadWrite8B (unsigned char data)
 Using SPI to transmit one byte and return the received byte.
static uint16_t AD5940_ReadWrite16B (uint16_t data)
 Using SPI to transmit two bytes and return the received bytes.
static uint32_t AD5940_ReadWrite32B (uint32_t data)
 Using SPI to transmit four bytes and return the received bytes.
static void AD5940_SPIWriteReg (uint16_t RegAddr, uint32_t RegData)
 Write register through SPI.
static uint32_t AD5940_SPIReadReg (uint16_t RegAddr)
 Read register through SPI.
void AD5940_FIFORd (uint32_t *pBuffer, uint32_t uiReadCount)
 Read specific number of data from FIFO with optimized SPI access.

Detailed Description

The basic SPI protocols.

All functions are basic on AD5940_ReadWriteNBytes which provided by user.

#SPI basic protocol All SPI protocol starts with one-byte command word. Following are data(16B or 32B) There are four SPI commands available SPI_Block_Const.


Function Documentation

void AD5940_FIFORd ( uint32_t *  pBuffer,
uint32_t  uiReadCount 
)

Read specific number of data from FIFO with optimized SPI access.

Parameters:
pBuffer,:Pointer to a buffer that used to store data read back.
uiReadCount,:How much data to be read.
Returns:
none.

Definition at line 866 of file ad5940.c.

static uint16_t AD5940_ReadWrite16B ( uint16_t  data ) [static]

Using SPI to transmit two bytes and return the received bytes.

Parameters:
data,:The 16-bit data SPI will transmit.
Returns:
received data.

Definition at line 905 of file ad5940.c.

static uint32_t AD5940_ReadWrite32B ( uint32_t  data ) [static]

Using SPI to transmit four bytes and return the received bytes.

Parameters:
data,:The 32-bit data SPI will transmit.
Returns:
received data.

Definition at line 920 of file ad5940.c.

static unsigned char AD5940_ReadWrite8B ( unsigned char  data ) [static]

Using SPI to transmit one byte and return the received byte.

Parameters:
data,:The 8-bit data SPI will transmit.
Returns:
received data.

Definition at line 892 of file ad5940.c.

static uint32_t AD5940_SPIReadReg ( uint16_t  RegAddr ) [static]

Read register through SPI.

Parameters:
RegAddr,:The register address.
Returns:
Return register data.

Definition at line 961 of file ad5940.c.

static void AD5940_SPIWriteReg ( uint16_t  RegAddr,
uint32_t  RegData 
) [static]

Write register through SPI.

Parameters:
RegAddr,:The register address.
RegData,:The register data.
Returns:
Return None.

Definition at line 939 of file ad5940.c.