aboutsummaryrefslogtreecommitdiffstats
path: root/wirish
diff options
context:
space:
mode:
authorPerry Hung <iperry@alum.mit.edu>2010-04-29 00:44:29 -0400
committerPerry Hung <iperry@alum.mit.edu>2010-04-29 00:44:29 -0400
commit2c51cc19ccb5c08eb4d89d197623da6cd92b35f7 (patch)
treea68f0d6349119b85766207374824d8468fc9e6ea /wirish
parent3988feb5e6fd9f22a3201c419f0db6ea0c1a07f2 (diff)
parenta7031b147c9ee77d1ed04ec419a7a23edd08014a (diff)
downloadlibrambutan-2c51cc19ccb5c08eb4d89d197623da6cd92b35f7.tar.gz
librambutan-2c51cc19ccb5c08eb4d89d197623da6cd92b35f7.zip
Merge branch 'spi'
Diffstat (limited to 'wirish')
-rw-r--r--wirish/comm/HardwareSPI.cpp8
-rw-r--r--wirish/comm/HardwareSPI.h3
2 files changed, 8 insertions, 3 deletions
diff --git a/wirish/comm/HardwareSPI.cpp b/wirish/comm/HardwareSPI.cpp
index e083ac1..3dfe10a 100644
--- a/wirish/comm/HardwareSPI.cpp
+++ b/wirish/comm/HardwareSPI.cpp
@@ -118,8 +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(this->spi_num, data);
+uint8 HardwareSPI::send(uint8 data) {
+ return spi_tx_byte(this->spi_num, data);
+}
+
+uint8 HardwareSPI::send(uint8 *buf, uint32 len) {
+ return spi_tx(this->spi_num, buf, len);
}
diff --git a/wirish/comm/HardwareSPI.h b/wirish/comm/HardwareSPI.h
index b974334..e606c0c 100644
--- a/wirish/comm/HardwareSPI.h
+++ b/wirish/comm/HardwareSPI.h
@@ -49,7 +49,8 @@ class HardwareSPI {
HardwareSPI(uint32 spi_num);
void begin(void);
void begin(SPIFrequency freq, uint32 endianness, uint32 mode);
- void send(uint8 data);
+ uint8 send(uint8 data);
+ uint8 send(uint8 *data, uint32 length);
uint8 recv(void);
};