Warn against and check for non-DMA-capable pointers being passed to SPI when DMA is used

This commit is contained in:
Jeroen Domburg
2017-05-05 11:55:19 +08:00
parent 530c3ca05c
commit 8af3fe4e84
5 changed files with 29 additions and 0 deletions

View File

@@ -69,6 +69,10 @@ struct spi_slave_transaction_t {
* @param dma_chan Either 1 or 2. A SPI bus used by this driver must have a DMA channel associated with
* it. The SPI hardware has two DMA channels to share. This parameter indicates which
* one to use.
*
* @warning If a DMA channel is selected, any transmit and receive buffer used should be allocated in
* DMA-capable memory.
*
* @return
* - ESP_ERR_INVALID_ARG if configuration is invalid
* - ESP_ERR_INVALID_STATE if host already is in use