Functions | |
int | Spi_Configure (int channel, int bits, int clockDivider, int delayBeforeSPCK, int delayBetweenTransfers) |
Configure the SPI channel. | |
int | Spi_ReadWriteBlock (int channel, unsigned char *buffer, int count) |
Read/Write a block of data via SPI. |
See EEPROM module for an example use.
int Spi_Configure | ( | int | channel, | |
int | bits, | |||
int | clockDivider, | |||
int | delayBeforeSPCK, | |||
int | delayBetweenTransfers | |||
) |
Configure the SPI channel.
This function locks the I/O lines associated with the SPI channel so they cannot be used by another device on the same lines.
channel | An integer specifying the SPI channel to configure. | |
bits | An integer specifying the number of bits to transfer (8-16). | |
clockDivider | An integer specifying the desired divider from the serial clock (0 - 255). | |
delayBeforeSPCK | An integer specifying the delay, in ms, before the clock starts (0 - 255). | |
delayBetweenTransfers | An integer specifying how long, in ms, to wait between transfers (0 - 255). |
int Spi_ReadWriteBlock | ( | int | channel, | |
unsigned char * | buffer, | |||
int | count | |||
) |
Read/Write a block of data via SPI.
channel | An integer specifying the device to communicate with. | |
buffer | A pointer to the buffer to read to, or write from. | |
count | An integer specifying the length in bytes of the buffer to read/write. |