diff options
| author | blmorris | 2015-06-22 09:24:59 -0400 |
|---|---|---|
| committer | Damien George | 2015-06-24 17:48:52 +0100 |
| commit | c5175526dda06d278dd569dd7bfce0c65cbbe5fc (patch) | |
| tree | 004a5e65a9fa3d1e8672b587f7b329edf517ba33 /stmhal/dma.h | |
| parent | 3299f687f5b3b328008b568473c31dc8796a43c4 (diff) | |
stmhal/dma.c: Modify dma_init() to accept init struct as an argument
This removes hard-coded DMA init params from dma_init(), instead defining
these parameters in a DMA_InitTypeDef struct that gets passed as an
argument to dma_init()
This makes dma_init more generic so it can be used for I2S and SD Card,
which require different initialization parameters.
Diffstat (limited to 'stmhal/dma.h')
| -rw-r--r-- | stmhal/dma.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stmhal/dma.h b/stmhal/dma.h index fc651ff15..d4f7b6cae 100644 --- a/stmhal/dma.h +++ b/stmhal/dma.h @@ -24,6 +24,8 @@ * THE SOFTWARE. */ -void dma_init(DMA_HandleTypeDef *dma, DMA_Stream_TypeDef *dma_stream, uint32_t dma_channel, uint32_t direction, void *data); +extern const DMA_InitTypeDef dma_init_struct_spi_i2c; + +void dma_init(DMA_HandleTypeDef *dma, DMA_Stream_TypeDef *dma_stream, const DMA_InitTypeDef *dma_init, uint32_t dma_channel, uint32_t direction, void *data); void dma_deinit(DMA_HandleTypeDef *dma); void dma_invalidate_channel(DMA_Stream_TypeDef *dma_stream, uint32_t dma_channel); |
