diff options
Diffstat (limited to 'peripheral/libmraa/api/mraa/spi.hpp')
-rw-r--r-- | peripheral/libmraa/api/mraa/spi.hpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/peripheral/libmraa/api/mraa/spi.hpp b/peripheral/libmraa/api/mraa/spi.hpp index 94a3f64..e5ffb09 100644 --- a/peripheral/libmraa/api/mraa/spi.hpp +++ b/peripheral/libmraa/api/mraa/spi.hpp @@ -80,20 +80,6 @@ class Spi } /** - * Spi Constructor, takes a pointer to a SPI context and initialises - * the SPI class - * - * @param void * to SPI context - */ - Spi(void* spi_context) - { - m_spi = (mraa_spi_context) spi_context; - if (m_spi == NULL) { - throw std::invalid_argument("Invalid SPI context"); - } - } - - /** * Closes spi bus */ ~Spi() @@ -141,10 +127,10 @@ class Spi * Write single byte to the SPI device * * @param data the byte to send - * @return data received on the miso line or -1 in case of error + * @return data received on the miso line */ - int - writeWord(uint16_t data) + uint16_t + write_word(uint16_t data) { return mraa_spi_write_word(m_spi, (uint16_t) data); } @@ -175,7 +161,7 @@ class Spi * @return uint8_t* data received on the miso line. Same length as passed in */ uint16_t* - writeWord(uint16_t* txBuf, int length) + write_word(uint16_t* txBuf, int length) { return mraa_spi_write_buf_word(m_spi, txBuf, length); } |