This section covers functions related to the SAM L22's built-in SPI driver, including configuring the SPI bus and writing to / reading from devices.
More...
|
void | watch_enable_spi (void) |
| Enables the SPI peripheral. Call this before attempting to interface with SPI devices.
|
|
void | watch_disable_spi (void) |
| Disables the SPI peripheral.
|
|
bool | watch_spi_write (const uint8_t *buf, uint16_t length) |
| Writes a series of values to a device on the SPI bus.
|
|
bool | watch_spi_read (uint8_t *buf, uint16_t length) |
| Reads a series of values from a device on the SPI bus.
|
|
bool | watch_spi_transfer (const uint8_t *data_out, uint8_t *data_in, uint16_t length) |
| Reads a series of values from a device on the SPI bus.
|
|
This section covers functions related to the SAM L22's built-in SPI driver, including configuring the SPI bus and writing to / reading from devices.
◆ watch_spi_read()
bool watch_spi_read |
( |
uint8_t * |
buf, |
|
|
uint16_t |
length |
|
) |
| |
Reads a series of values from a device on the SPI bus.
- Parameters
-
buf | Storage for the incoming bytes; on return, it will contain the received data. |
length | The number of bytes that you wish to receive. |
- Note
- This function does not manage the chip select pin (usually A3).
◆ watch_spi_transfer()
bool watch_spi_transfer |
( |
const uint8_t * |
data_out, |
|
|
uint8_t * |
data_in, |
|
|
uint16_t |
length |
|
) |
| |
Reads a series of values from a device on the SPI bus.
- Parameters
-
data_out | Storage for outgoing bytes. |
data_in | Storage for incoming bytes. |
length | The number of bytes to transfer. |
- Note
- This function does not manage the chip select pin (usually A3).
◆ watch_spi_write()
bool watch_spi_write |
( |
const uint8_t * |
buf, |
|
|
uint16_t |
length |
|
) |
| |
Writes a series of values to a device on the SPI bus.
- Parameters
-
buf | A series of unsigned bytes; the data you wish to transmit. |
length | The number of bytes in buf that you wish to send. |
- Note
- This function does not manage the chip select pin (usually A3).