SPI DMA new functions
victor_pv Sat May 16, 2015 8:49 pm
The new functions are integrated in the latest update of Roger’s repo.
Check the .h file for a short explanation of the parameters and what they do, right before each of the functions.
**************************************************************
Roger,
I am opening a thread for this as we haven’t discussed it since you opened the new forums.
I just went back to the ILI 9163C library that I had ported, and gave a quick thought to the DMA functions, and just made a small change to allow to select Memory Increment or Circular mode with an optional parameter.
The function declarations look like this:
/**
* @brief Sets up a DMA Transfer for "length" bytes.
*
* This function transmits and receives to buffers.
*
* @param transmitBuf buffer Bytes to transmit. If passed as 0, it sends FF repeatedly for "length" bytes
* @param receiveBuf buffer Bytes to save received data.
* @param length Number of bytes in buffer to transmit.
*/
uint8 dmaTransfer(uint8 *transmitBuf, uint8 *receiveBuf, uint16 length);
/**
* @brief Sets up a DMA Transmit for bytes.
*
* This function transmits and does not care about the RX fifo.
*
* @param transmitBuf buffer Bytes to transmit,
* @param length Number of bytes in buffer to transmit.
* @param minc Set to use Memory Increment mode, clear to use Circular mode.
*/
uint8 dmaSend(uint8 *transmitBuf, uint16 length, bool minc));
/**
* @brief Sets up a DMA Transmit for half words.
* SPI PERFIPHERAL MUST BE SET TO 16 BIT MODE BEFORE
*
* This function transmits and does not care about the RX fifo.
*
* @param data buffer half words to transmit,
* @param length Number of bytes in buffer to transmit.
* @param minc Set to use Memory Increment mode (default if blank), clear to use Circular mode.
*/
uint8 dmaSend(uint16 *transmitBuf, uint16 length, bool minc);
