/** * \file * * * \brief SPI driver with DMA. * * \note Only one copy of SpiDmaAt91 is allowed for each application. * * \author Francesco Sacchi * \author Luca Ottaviano */ #ifndef DRV_SPI_DMA_AT91_H #define DRV_SPI_DMA_AT91_H #include typedef struct SpiDmaAt91 { KFile fd; } SpiDmaAt91; #define KFT_SPIDMAAT91 MAKE_ID('S', 'P', 'I', 'A') INLINE SpiDmaAt91 * SPIDMAAT91_CAST(KFile *fd) { ASSERT(fd->_type == KFT_SPIDMAAT91); return (SpiDmaAt91 *)fd; } /** * Init DMA SPI driver. * \param spi A pointer to a SpiDmaAt91 structure. */ void spi_dma_init(SpiDmaAt91 *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_AT91_H */