fix(spi_master): this fix the SPI MOSI output missing bug.

This commit is contained in:
michael
2017-08-31 19:59:30 +08:00
committed by Ivan Grokhotkov
parent f254555a41
commit b834fcf78a
5 changed files with 82 additions and 7 deletions
@@ -44,6 +44,7 @@ typedef enum {
PERIPH_SPI_MODULE,
PERIPH_HSPI_MODULE,
PERIPH_VSPI_MODULE,
PERIPH_SPI_DMA_MODULE,
} periph_module_t;
/**
+20 -4
View File
@@ -74,11 +74,30 @@ bool spicommon_periph_claim(spi_host_device_t host);
/**
* @brief Return the SPI peripheral so another driver can claim it.
*
* @param host Peripheral to claim
* @param host Peripheral to return
* @return True if peripheral is returned successfully; false if peripheral was free to claim already.
*/
bool spicommon_periph_free(spi_host_device_t host);
/**
* @brief Try to claim a SPI DMA channel
*
* Call this if your driver wants to use SPI with a DMA channnel.
*
* @param dma_chan channel to claim
*
* @return True if success; false otherwise.
*/
bool spicommon_dma_chan_claim(int dma_chan);
/**
* @brief Return the SPI DMA channel so other driver can claim it, or just to power down DMA.
*
* @param dma_chan channel to return
*
* @return True if success; false otherwise.
*/
bool spicommon_dma_chan_free(int dma_chan);
#define SPICOMMON_BUSFLAG_SLAVE 0 ///< Initialize I/O in slave mode
#define SPICOMMON_BUSFLAG_MASTER (1<<0) ///< Initialize I/O in master mode
@@ -170,9 +189,6 @@ spi_dev_t *spicommon_hw_for_host(spi_host_device_t host);
*/
int spicommon_irqsource_for_host(spi_host_device_t host);
/**
* Callback, to be called when a DMA engine reset is completed
*/