Little-Wire
 All Classes Functions Groups Pages
SPI

Serial peripheral interface functions. More...

Functions

void spi_init (littleWire *lwHandle)
 
void spi_sendMessage (littleWire *lwHandle, unsigned char *sendBuffer, unsigned char *inputBuffer, unsigned char length, unsigned char mode)
 
unsigned char debugSpi (littleWire *lwHandle, unsigned char message)
 
void spi_updateDelay (littleWire *lwHandle, unsigned int duration)
 

Detailed Description

Serial peripheral interface functions.

Function Documentation

unsigned char debugSpi ( littleWire *  lwHandle,
unsigned char  message 
)

Send one byte SPI message over MOSI pin. Slightly slower than the actual one.
There isn't any chip select control involved. Useful for debug console app

Parameters
lwHandlelittleWire device pointer
messageMessage to send
Returns
Received SPI message

Definition at line 270 of file littleWire.c.

void spi_init ( littleWire *  lwHandle)

Initialize the SPI module on the Little-Wire

Parameters
lwHandlelittleWire device pointer
Returns
(none)

Definition at line 254 of file littleWire.c.

void spi_sendMessage ( littleWire *  lwHandle,
unsigned char *  sendBuffer,
unsigned char *  inputBuffer,
unsigned char  length,
unsigned char  mode 
)

Send SPI message(s). SPI Mode is 0.

Parameters
lwHandlelittleWire device pointer
sendBufferMessage array to send
inputBufferReturned answer message
lengthMessage length - maximum 4
modeAUTO_CS or MANUAL_CS
Returns
(none)

Definition at line 259 of file littleWire.c.

void spi_updateDelay ( littleWire *  lwHandle,
unsigned int  duration 
)

Change the SPI message frequency by adjusting delay duration. By default, Little-Wire sends the SPI messages with maximum speed.
If your hardware can't catch up with the speed, increase the duration value to lower the SPI speed.

Parameters
lwHandlelittleWire device pointer
durationAmount of delay.
Returns
(none)

Definition at line 277 of file littleWire.c.