MAV'RIC
|
Implementation of spi peripheral for avr32. More...
#include <spi_avr32.hpp>
Public Member Functions | |
Spi_avr32 (spi_avr32_conf_t config) | |
Initialises the peripheral. | |
bool | init (void) |
Hardware initialization. | |
bool | write (const uint8_t *bytes, const uint32_t size=1) |
Write bytes on the spi line. | |
bool | read (uint16_t command, uint8_t *bytes, const uint32_t size=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. |
Implementation of spi peripheral for avr32.
Spi_avr32::Spi_avr32 | ( | spi_avr32_conf_t | config | ) |
Initialises the peripheral.
config | Device configuration |
bool Spi_avr32::init | ( | void | ) | [virtual] |
bool Spi_avr32::read | ( | uint16_t | command, |
uint8_t * | bytes, | ||
const uint32_t | size = 1 |
||
) |
Read bytes from the spi line.
command | Reading command |
bytes | Incoming bytes |
size | Number of bytes to read |
bool Spi_avr32::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_avr32::write | ( | const uint8_t * | bytes, |
const uint32_t | size = 1 |
||
) |
Write bytes on the spi line.
byte | Outgoing bytes |
size | Number of bytes to write |