Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
STM32 DMA subsystem driver header. More...
#include "hal_stm32_dma.h"
Go to the source code of this file.
Functions | |
static void | dma_lld_serve_interrupt (DMADriver *dmap, uint32_t flags) |
DMA ISR service routine. More... | |
void | dmaObjectInit (DMADriver *dmap) |
bool | dmaStart (DMADriver *dmap, const DMAConfig *cfg) |
Configures and activates the DMA peripheral. More... | |
void | dmaStop (DMADriver *dmap) |
Deactivates the DMA peripheral. More... | |
bool | dmaStartTransfert (DMADriver *dmap, volatile void *periphp, void *mem0p, const size_t size) |
Starts a DMA transaction. More... | |
bool | dmaStartTransfertI (DMADriver *dmap, volatile void *periphp, void *mem0p, const size_t size) |
Starts a DMA transaction. More... | |
void | dmaStopTransfert (DMADriver *dmap) |
Stops an ongoing transaction. More... | |
void | dmaStopTransfertI (DMADriver *dmap) |
Stops an ongoing transaction. More... | |
msg_t | dmaTransfertTimeout (DMADriver *dmap, volatile void *periphp, void *mem0p, const size_t size, sysinterval_t timeout) |
Performs a DMA transaction. More... | |
void | dmaAcquireBus (DMADriver *dmap) |
Gains exclusive access to the DMA peripheral. More... | |
void | dmaReleaseBus (DMADriver *dmap) |
Releases exclusive access to the DMA peripheral. More... | |
bool | dma_lld_start (DMADriver *dmap) |
Configures and activates the DMA peripheral. More... | |
bool | dma_lld_start_transfert (DMADriver *dmap, volatile void *periphp, void *mem0p, const size_t size) |
Starts a DMA transaction. More... | |
void | dma_lld_stop_transfert (DMADriver *dmap) |
Stops an ongoing transaction. More... | |
void | dma_lld_stop (DMADriver *dmap) |
Deactivates the DMA peripheral. More... | |
STM32 DMA subsystem driver header.
Definition in file hal_stm32_dma.c.
DMA ISR service routine.
DMA DMA ISR service routine.
[in] | dmap | pointer to the DMADriver object |
[in] | flags | pre-shifted content of the ISR register |
Definition at line 704 of file hal_stm32_dma.c.
References _dma_isr_error_code(), _dma_isr_full_code(), _dma_isr_half_code(), DMA_ACTIVE, DMA_ERR_DIRECTMODE_ERROR, DMA_ERR_FIFO_ERROR, DMA_ERR_TRANSFER_ERROR, and DMADriver::state.
Referenced by dma_lld_start().
bool dma_lld_start | ( | DMADriver * | dmap | ) |
Configures and activates the DMA peripheral.
[in] | dmap | pointer to the DMADriver object |
Definition at line 383 of file hal_stm32_dma.c.
References DMAConfig::circular, DMADriver::config, DMADriver::controller, DMAConfig::direction, DMA_DIR_M2M, DMA_DIR_M2P, DMA_DIR_P2M, dma_lld_serve_interrupt(), DMAConfig::dma_priority, DMADriver::dmamode, DMADriver::dmastream, DMAConfig::end_cb, DMAConfig::error_cb, DMAConfig::inc_memory_addr, DMAConfig::inc_peripheral_addr, DMAConfig::irq_priority, DMAConfig::msize, DMAConfig::psize, STM32_DMA_SUPPORTS_CSELR, and DMAConfig::stream.
Referenced by dmaStart().
bool dma_lld_start_transfert | ( | DMADriver * | dmap, |
volatile void * | periphp, | ||
void * | mem0p, | ||
const size_t | size | ||
) |
Starts a DMA transaction.
[in] | dmap | pointer to the DMADriver object |
Definition at line 656 of file hal_stm32_dma.c.
References DMADriver::dmamode, DMADriver::dmastream, DMADriver::mem0p, and DMADriver::size.
Referenced by dmaStartTransfertI().
void dma_lld_stop | ( | DMADriver * | dmap | ) |
Deactivates the DMA peripheral.
[in] | dmap | pointer to the DMADriver object |
Definition at line 688 of file hal_stm32_dma.c.
References DMADriver::dmastream.
Referenced by dmaStop().
void dma_lld_stop_transfert | ( | DMADriver * | dmap | ) |
Stops an ongoing transaction.
[in] | dmap | pointer to the DMADriver object |
Definition at line 676 of file hal_stm32_dma.c.
References DMADriver::dmastream.
Referenced by _dma_isr_error_code(), _dma_isr_full_code(), dmaStopTransfert(), and dmaStopTransfertI().
void dmaAcquireBus | ( | DMADriver * | dmap | ) |
Gains exclusive access to the DMA peripheral.
This function tries to gain ownership to the DMA bus, if the bus is already being used then the invoking thread is queued.
DMA_USE_MUTUAL_EXCLUSION
must be enabled.[in] | dmap | pointer to the DMADriver object |
Definition at line 332 of file hal_stm32_dma.c.
void dmaObjectInit | ( | DMADriver * | dmap | ) |
Definition at line 53 of file hal_stm32_dma.c.
References DMADriver::config, DMA_STOP, DMADriver::mem0p, and DMADriver::state.
Referenced by dshotStart(), and light_ws2812_arch_init().
void dmaReleaseBus | ( | DMADriver * | dmap | ) |
Releases exclusive access to the DMA peripheral.
DMA_USE_MUTUAL_EXCLUSION
must be enabled.[in] | dmap | pointer to the DMADriver object |
Definition at line 349 of file hal_stm32_dma.c.
Configures and activates the DMA peripheral.
true | dma driver is OK |
false | incoherencies has been found in config |
Definition at line 85 of file hal_stm32_dma.c.
References DMADriver::config, dma_lld_start(), DMA_READY, DMA_STOP, and DMADriver::state.
Referenced by dshotStart(), and light_ws2812_arch_init().
bool dmaStartTransfert | ( | DMADriver * | dmap, |
volatile void * | periphp, | ||
void * | mem0p, | ||
const size_t | size | ||
) |
Starts a DMA transaction.
Starts one or many asynchronous dma transaction(s) depending on continuous field
[in] | dmap | pointer to the DMADriver object |
[in,out] | periphp | pointer to a peripheral register address |
[in,out] | mem0p | pointer to the data buffer |
[in] | size | buffer size. The buffer size must be one or an even number. |
Definition at line 142 of file hal_stm32_dma.c.
References dmaStartTransfertI().
Referenced by dshotSendFrame(), and light_ws2812_arch_init().
bool dmaStartTransfertI | ( | DMADriver * | dmap, |
volatile void * | periphp, | ||
void * | mem0p, | ||
const size_t | size | ||
) |
Starts a DMA transaction.
Starts one or many asynchronous dma transaction(s) depending on continuous field
[in] | dmap | pointer to the DMADriver object |
[in,out] | periphp | pointer to a peripheral register address |
[in,out] | mem0p | pointer to the data buffer |
[in] | size | buffer size. The buffer size must be one or an even number. |
Definition at line 167 of file hal_stm32_dma.c.
References DMADriver::config, DMA_ACTIVE, DMA_COMPLETE, DMA_ERROR, dma_lld_start_transfert(), DMA_READY, DMAConfig::msize, DMAConfig::psize, and DMADriver::state.
Referenced by dmaStartTransfert(), and dmaTransfertTimeout().
void dmaStop | ( | DMADriver * | dmap | ) |
Deactivates the DMA peripheral.
[in] | dmap | pointer to the DMADriver object |
Definition at line 107 of file hal_stm32_dma.c.
References DMADriver::config, dma_lld_stop(), DMA_READY, DMA_STOP, DMADriver::mem0p, and DMADriver::state.
void dmaStopTransfert | ( | DMADriver * | dmap | ) |
Stops an ongoing transaction.
This function stops the currently ongoing transaction and returns the driver in the DMA_READY
state. If there was no transaction being processed then the function does nothing.
[in] | dmap | pointer to the DMADriver object |
Definition at line 232 of file hal_stm32_dma.c.
References _dma_reset_s, DMA_ACTIVE, dma_lld_stop_transfert(), DMA_READY, and DMADriver::state.
void dmaStopTransfertI | ( | DMADriver * | dmap | ) |
Stops an ongoing transaction.
This function stops the currently ongoing transaction and returns the driver in the DMA_READY
state. If there was no transaction being processed then the function does nothing.
[in] | dmap | pointer to the DMADriver object |
Definition at line 260 of file hal_stm32_dma.c.
References _dma_reset_i, DMA_ACTIVE, DMA_COMPLETE, dma_lld_stop_transfert(), DMA_READY, and DMADriver::state.
Referenced by dmaTransfertTimeout().
msg_t dmaTransfertTimeout | ( | DMADriver * | dmap, |
volatile void * | periphp, | ||
void * | mem0p, | ||
const size_t | size, | ||
sysinterval_t | timeout | ||
) |
Performs a DMA transaction.
Performs one synchronous dma transaction
[in] | dmap | pointer to the DMADriver object |
[in,out] | periphp | pointer to a peripheral register address |
[in,out] | mem0p | pointer to the data buffer |
[in] | size | buffer size. The buffer size must be one or an even number. |
[in] | timeout | function will exit after timeout is transaction is not done can be TIME_INFINITE (but not TIME_IMMEDIATE) |
MSG_OK | Transaction finished. |
MSG_RESET | The transaction has been stopped using dmaStopTransaction() or dmaStopTransactionI() , the result buffer may contain incorrect data. |
MSG_TIMEOUT | The transaction has been stopped because of hardware error or timeout limit reach |
Definition at line 303 of file hal_stm32_dma.c.
References dmaStartTransfertI(), dmaStopTransfertI(), and msg.
Referenced by dmaTransfert().