Uses DMA to read/write SPI blocks, while putting the current thread in Wait state.
Diff: RTOS_SPI_LPC1768.cpp
- Revision:
- 2:d052724e2ad6
- Parent:
- 1:d021fb155bff
--- a/RTOS_SPI_LPC1768.cpp Sun Jan 05 10:20:17 2014 +0000 +++ b/RTOS_SPI_LPC1768.cpp Fri Jun 27 10:12:42 2014 +0000 @@ -14,7 +14,7 @@ write_dma.destination(&_spi.spi->DR, false, 8); }; -void RTOS_SPI::bulkInternal(uint8_t *read_data, uint8_t *write_data, int length, bool read_inc, bool write_inc) { +void RTOS_SPI::bulkInternal(uint8_t *read_data, const uint8_t *write_data, int length, bool read_inc, bool write_inc) { aquire(); _spi.spi->DMACR = 3;