Files | |
| file | spi.c |
| SPI implementation (license: GPLv2). | |
| file | spi.h |
| SPI header (license: GPLv2). | |
| file | spi_config.h |
| SPI support configuration (license: GPLv2 or LGPLv2.1). | |
Functions | |
| void | spi_init () |
| Initializes the SPI interface. | |
| void | spi_send_byte (uint8_t b) |
| Sends a byte over the SPI bus. | |
| uint8_t | spi_rec_byte () |
| Receives a byte from the SPI bus. | |
| void | spi_send_data (const uint8_t *data, uint16_t data_len) |
| Sends data contained in a buffer over the SPI bus. | |
| void | spi_rec_data (uint8_t *buffer, uint16_t buffer_len) |
| Receives multiple bytes from the SPI bus and writes them to a buffer. | |
| void | spi_low_frequency () |
| Switches to the lowest SPI frequency possible. | |
| void | spi_high_frequency () |
| Switches to the highest SPI frequency possible. | |
| void spi_init | ( | ) |
Initializes the SPI interface.
By default, the highest SPI frequency available is used.
| void spi_send_byte | ( | uint8_t | b | ) |
Sends a byte over the SPI bus.
| [in] | b | The byte to send. |
| uint8_t spi_rec_byte | ( | ) |
Receives a byte from the SPI bus.
| void spi_send_data | ( | const uint8_t * | data, | |
| uint16_t | data_len | |||
| ) |
Sends data contained in a buffer over the SPI bus.
| [in] | data | A pointer to the buffer which contains the data to send. |
| [in] | data_len | The number of bytes to send. |
| void spi_rec_data | ( | uint8_t * | buffer, | |
| uint16_t | buffer_len | |||
| ) |
Receives multiple bytes from the SPI bus and writes them to a buffer.
| [out] | buffer | A pointer to the buffer into which the data gets written. |
| [in] | buffer_len | The number of bytes to read. |
1.5.5