Little-Wire
Functions
SPI

Functions

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

Detailed Description

SPI functions


Function Documentation

Initialize the SPI module on the Little-Wire

Returns:
(none)
unsigned char littleWire::spi_sendMessage ( unsigned char  message)

Send and receive a single byte SPI message. Chip select is always manual

Parameters:
messageMessage to send
Returns:
Response byte
void littleWire::spi_sendMessageMulti ( unsigned char *  sendBuffer,
unsigned char *  inputBuffer,
unsigned char  length,
unsigned char  mode 
)

Send and receive multiple (up to 4 bytes) SPI messages. Chip select is automatic or manual.
If automatic chip select is selected, RESET_PIN stays HIGH in idle time , and goes to LOW while sending the messages over SPI

Parameters:
sendBufferPointer of the array which has your messages to send.
inputBufferPointer of the array which you want to store SPI response messages.
lengthLength of the messages. ( Maximum is 4)
modeChip select mode. (AUTO_CS or MANUAL_CS )
Returns:
(none)
void littleWire::spi_updateDelay ( 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:
durationAmount of delay.
Returns:
(none)
 All Classes Functions