Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: STM32L452_Nucleo_ticker
Fork of mbed-dev by
Diff: drivers/SPI.cpp
- Revision:
- 167:e84263d55307
- Parent:
- 160:d5399cc887bb
- Child:
- 169:e3b6fe271b81
diff -r c97ed07ec1a8 -r e84263d55307 drivers/SPI.cpp
--- a/drivers/SPI.cpp Thu Jun 08 15:02:37 2017 +0100
+++ b/drivers/SPI.cpp Wed Jun 21 17:46:44 2017 +0100
@@ -78,6 +78,14 @@
return ret;
}
+int SPI::write(const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length) {
+ lock();
+ aquire();
+ int ret = spi_master_block_write(&_spi, tx_buffer, tx_length, rx_buffer, rx_length);
+ unlock();
+ return ret;
+}
+
void SPI::lock() {
_mutex->lock();
}
