|
Little-Wire
|
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) |
Serial peripheral interface functions.
| 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
| lwHandle | littleWire device pointer |
| message | Message to send |
Definition at line 270 of file littleWire.c.
| void spi_init | ( | littleWire * | lwHandle) |
Initialize the SPI module on the Little-Wire
| lwHandle | littleWire device pointer |
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.
| lwHandle | littleWire device pointer |
| sendBuffer | Message array to send |
| inputBuffer | Returned answer message |
| length | Message length - maximum 4 |
| mode | AUTO_CS or MANUAL_CS |
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.
| lwHandle | littleWire device pointer |
| duration | Amount of delay. |
Definition at line 277 of file littleWire.c.