/** * \file * * * \brief SPI driver with DMA. * * \note Only one copy of SpiDma is allowed for each application. * * \author Francesco Sacchi * \author Luca Ottaviano * \author Daniele Basile */ #ifndef DRV_SPI_DMA_H #define DRV_SPI_DMA_H #include typedef struct SpiDma { KFile fd; } SpiDma; #define KFT_SPIDMA MAKE_ID('S', 'P', 'I', 'D') INLINE SpiDma * SPIDMA_CAST(KFile *fd) { ASSERT(fd->_type == KFT_SPIDMA); return (SpiDma *)fd; } /** * Init DMA SPI driver. * \param spi A pointer to a SpiDma structure. */ void spi_dma_init(SpiDma *spi); /** * Set the clock rate for SPI bus. * * \param rate The rate you want to set for SPI. */ void spi_dma_setclock(uint32_t rate); #endif /* DRV_SPI_DMA_H */