From a7031b147c9ee77d1ed04ec419a7a23edd08014a Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Wed, 28 Apr 2010 19:19:34 -0400 Subject: Various SPI changes. -Read DR after each master send, return the response. -Added a send function to allow you to pass buffers to the SPI peripheral instead of goin a byte at a time. --- wirish/comm/HardwareSPI.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'wirish/comm/HardwareSPI.cpp') diff --git a/wirish/comm/HardwareSPI.cpp b/wirish/comm/HardwareSPI.cpp index 4379a0d..3dfe10a 100644 --- a/wirish/comm/HardwareSPI.cpp +++ b/wirish/comm/HardwareSPI.cpp @@ -118,12 +118,12 @@ void HardwareSPI::begin(void) { * @brief send a byte out the spi peripheral * @param data byte to send */ -void HardwareSPI::send(uint8 data) { - spi_tx_byte(this->spi_num, data); +uint8 HardwareSPI::send(uint8 data) { + return spi_tx_byte(this->spi_num, data); } -void HardwareSPI::send(uint8 *buf, uint32 len) { - spi_tx(this->spi_num, buf, len); +uint8 HardwareSPI::send(uint8 *buf, uint32 len) { + return spi_tx(this->spi_num, buf, len); } -- cgit v1.2.3