69 throw std::invalid_argument(
"Error initialising SPI bus");
84 throw std::invalid_argument(
"Error initialising SPI bus");
94 Spi(
void* spi_context)
98 throw std::invalid_argument(
"Invalid SPI context");
201 transfer(uint8_t* txBuf, uint8_t* rxBuf,
int length)
Result
Definition: types.hpp:204
Result frequency(int hz)
Definition: spi.hpp:129
unsigned int mraa_boolean_t
Definition: common.h:78
mraa_spi_context mraa_spi_init_raw(unsigned int bus, unsigned int cs)
mraa_result_t mraa_spi_lsbmode(mraa_spi_context dev, mraa_boolean_t lsb)
mraa_result_t mraa_spi_frequency(mraa_spi_context dev, int hz)
int writeWord(uint16_t data)
Definition: spi.hpp:153
mraa_result_t mraa_spi_bit_per_word(mraa_spi_context dev, unsigned int bits)
uint16_t * writeWord(uint16_t *txBuf, int length)
Definition: spi.hpp:184
Result bitPerWord(unsigned int bits)
Definition: spi.hpp:241
struct _spi * mraa_spi_context
Definition: spi.h:67
Spi(int bus, int cs)
Definition: spi.hpp:79
Spi(void *spi_context)
Definition: spi.hpp:94
Serial Peripheral Interface.
Result mode(Spi_Mode mode)
Definition: spi.hpp:117
Result transfer(uint8_t *txBuf, uint8_t *rxBuf, int length)
Definition: spi.hpp:201
Result lsbmode(bool lsb)
Definition: spi.hpp:229
uint8_t * write(uint8_t *txBuf, int length)
Definition: spi.hpp:168
int mraa_spi_write_word(mraa_spi_context dev, uint16_t data)
mraa_result_t mraa_spi_stop(mraa_spi_context dev)
int mraa_spi_write(mraa_spi_context dev, uint8_t data)
mraa_spi_mode_t
Definition: spi.h:53
int writeByte(uint8_t data)
Definition: spi.hpp:141
Spi(int bus)
Definition: spi.hpp:64
mraa_result_t mraa_spi_transfer_buf(mraa_spi_context dev, uint8_t *data, uint8_t *rxbuf, int length)
mraa_spi_context mraa_spi_init(int bus)
Spi_Mode
Definition: spi.hpp:37
uint8_t * mraa_spi_write_buf(mraa_spi_context dev, uint8_t *data, int length)
Result transfer_word(uint16_t *txBuf, uint16_t *rxBuf, int length)
Definition: spi.hpp:216
mraa_result_t mraa_spi_mode(mraa_spi_context dev, mraa_spi_mode_t mode)
API to Serial Peripheral Interface.
Definition: spi.hpp:56
uint16_t * mraa_spi_write_buf_word(mraa_spi_context dev, uint16_t *data, int length)
mraa_result_t mraa_spi_transfer_buf_word(mraa_spi_context dev, uint16_t *data, uint16_t *rxbuf, int length)
~Spi()
Definition: spi.hpp:105