MAV'RIC
|
Implementation of spi peripheral for stm32. More...
#include <spi_stm32.hpp>
Public Member Functions | |
Spi_stm32 (spi_stm32_conf_t spi_config) | |
Initialises the peripheral. | |
bool | init (void) |
Hardware initialization. | |
bool | write (uint8_t *bytes, uint32_t nbytes=1) |
Write bytes on the spi line. | |
bool | read (uint8_t *in_buffer, uint32_t nbytes=1) |
Read bytes from the spi line. | |
bool | transfer (uint8_t *out_buffer, uint8_t *in_buffer, uint32_t nbytes) |
Write and Read data to/from the SPI bus. | |
void | select_slave (void) |
Select slave. | |
void | unselect_slave (void) |
Unselect slave. |
Implementation of spi peripheral for stm32.
Spi_stm32::Spi_stm32 | ( | spi_stm32_conf_t | spi_config | ) |
Initialises the peripheral.
config | Device configuration |
bool Spi_stm32::init | ( | void | ) | [virtual] |
Hardware initialization.
Implements Spi.
bool Spi_stm32::read | ( | uint8_t * | in_buffer, |
uint32_t | nbytes = 1 |
||
) | [virtual] |
Read bytes from the spi line.
bytes | Incoming bytes |
nbytes | Number of bytes to read |
Implements Spi.
bool Spi_stm32::transfer | ( | uint8_t * | out_buffer, |
uint8_t * | in_buffer, | ||
uint32_t | nbytes | ||
) | [virtual] |
Write and Read data to/from the SPI bus.
out_buffer | Data buffer (output) |
in_buffer | Data buffer (input) |
nbytes | Number of bytes to write/read |
Implements Spi.
bool Spi_stm32::write | ( | uint8_t * | bytes, |
uint32_t | nbytes = 1 |
||
) | [virtual] |
Write bytes on the spi line.
byte | Outgoing bytes |
nbytes | Number of bytes to write |
Implements Spi.