Initialization and Configuration functions.
More...
|
void | DMA_Cmd (DMA_Channel_TypeDef *DMAy_Channelx, FunctionalState NewState) |
| Enables or disables the specified DMAy Channelx. More...
|
|
void | DMA_Cmd (DMA_Stream_TypeDef *DMAy_Streamx, FunctionalState NewState) |
| Enables or disables the specified DMAy Streamx. More...
|
|
void | DMA_DeInit (DMA_Channel_TypeDef *DMAy_Channelx) |
| Deinitializes the DMAy Channelx registers to their default reset values. More...
|
|
void | DMA_DeInit (DMA_Stream_TypeDef *DMAy_Streamx) |
| Deinitialize the DMAy Streamx registers to their default reset values. More...
|
|
void | DMA_FlowControllerConfig (DMA_Stream_TypeDef *DMAy_Streamx, uint32_t DMA_FlowCtrl) |
| Configures, when the DMAy Streamx is disabled, the flow controller for the next transactions (Peripheral or Memory). More...
|
|
void | DMA_Init (DMA_Channel_TypeDef *DMAy_Channelx, DMA_InitTypeDef *DMA_InitStruct) |
| Initializes the DMAy Channelx according to the specified parameters in the DMA_InitStruct. More...
|
|
void | DMA_Init (DMA_Stream_TypeDef *DMAy_Streamx, DMA_InitTypeDef *DMA_InitStruct) |
| Initializes the DMAy Streamx according to the specified parameters in the DMA_InitStruct structure. More...
|
|
void | DMA_PeriphIncOffsetSizeConfig (DMA_Stream_TypeDef *DMAy_Streamx, uint32_t DMA_Pincos) |
| Configures, when the PINC (Peripheral Increment address mode) bit is set, if the peripheral address should be incremented with the data size (configured with PSIZE bits) or by a fixed offset equal to 4 (32-bit aligned addresses). More...
|
|
void | DMA_StructInit (DMA_InitTypeDef *DMA_InitStruct) |
| Fills each DMA_InitStruct member with its default value. More...
|
|
Initialization and Configuration functions.
===============================================================================
##### Initialization and Configuration functions #####
===============================================================================
[..]
This subsection provides functions allowing to initialize the DMA Stream source
and destination addresses, incrementation and data sizes, transfer direction,
buffer size, circular/normal mode selection, memory-to-memory mode selection
and Stream priority value.
[..]
The DMA_Init() function follows the DMA configuration procedures as described in
reference manual (RM0090) except the first point: waiting on EN bit to be reset.
This condition should be checked by user application using the function DMA_GetCmdStatus()
before calling the DMA_Init() function.
===============================================================================
##### Initialization and Configuration functions #####
===============================================================================
[..] This subsection provides functions allowing to initialize the DMA channel
source and destination addresses, incrementation and data sizes, transfer
direction, buffer size, circular/normal mode selection, memory-to-memory
mode selection and channel priority value.
[..] The DMA_Init() function follows the DMA configuration procedures as described
in reference manual (RM00316).
Enables or disables the specified DMAy Channelx.
- Parameters
-
DMAy_Channelx | where y can be 1 or 2 to select the DMA and x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. |
NewState | new state of the DMAy Channelx. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 328 of file stm32f30x_dma.c.
Enables or disables the specified DMAy Streamx.
- Parameters
-
DMAy_Streamx | where y can be 1 or 2 to select the DMA and x can be 0 to 7 to select the DMA Stream. |
NewState | new state of the DMAy Streamx. This parameter can be: ENABLE or DISABLE. |
- Note
- This function may be used to perform Pause-Resume operation. When a transfer is ongoing, calling this function to disable the Stream will cause the transfer to be paused. All configuration registers and the number of remaining data will be preserved. When calling again this function to re-enable the Stream, the transfer will be resumed from the point where it was paused.
-
After configuring the DMA Stream (DMA_Init() function) and enabling the stream, it is recommended to check (or wait until) the DMA Stream is effectively enabled. A Stream may remain disabled if a configuration parameter is wrong. After disabling a DMA Stream, it is also recommended to check (or wait until) the DMA Stream is effectively disabled. If a Stream is disabled while a data transfer is ongoing, the current data will be transferred and the Stream will be effectively disabled only after the transfer of this single data is finished.
- Return values
-
Definition at line 478 of file stm32f4xx_dma.c.
Deinitializes the DMAy Channelx registers to their default reset values.
- Parameters
-
DMAy_Channelx | where y can be 1 or 2 to select the DMA and x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. |
- Return values
-
Definition at line 141 of file stm32f30x_dma.c.
Deinitialize the DMAy Streamx registers to their default reset values.
- Parameters
-
DMAy_Streamx | where y can be 1 or 2 to select the DMA and x can be 0 to 7 to select the DMA Stream. |
- Return values
-
Definition at line 196 of file stm32f4xx_dma.c.
void DMA_FlowControllerConfig |
( |
DMA_Stream_TypeDef * |
DMAy_Streamx, |
|
|
uint32_t |
DMA_FlowCtrl |
|
) |
| |
Configures, when the DMAy Streamx is disabled, the flow controller for the next transactions (Peripheral or Memory).
- Note
- Before enabling this feature, check if the used peripheral supports the Flow Controller mode or not.
- Parameters
-
DMAy_Streamx | where y can be 1 or 2 to select the DMA and x can be 0 to 7 to select the DMA Stream. |
DMA_FlowCtrl | specifies the DMA flow controller. This parameter can be one of the following values:
- DMA_FlowCtrl_Memory: DMAy_Streamx transactions flow controller is the DMA controller.
- DMA_FlowCtrl_Peripheral: DMAy_Streamx transactions flow controller is the peripheral.
|
- Return values
-
Definition at line 550 of file stm32f4xx_dma.c.
Initializes the DMAy Channelx according to the specified parameters in the DMA_InitStruct.
- Parameters
-
DMAy_Channelx | where y can be 1 or 2 to select the DMA and x can be 1 to 7 for DMA1 and 1 to 5 for DMA2 to select the DMA Channel. |
DMA_InitStruct | pointer to a DMA_InitTypeDef structure that contains the configuration information for the specified DMA Channel. |
- Return values
-
Definition at line 235 of file stm32f30x_dma.c.
Initializes the DMAy Streamx according to the specified parameters in the DMA_InitStruct structure.
- Note
- Before calling this function, it is recommended to check that the Stream is actually disabled using the function DMA_GetCmdStatus().
- Parameters
-
DMAy_Streamx | where y can be 1 or 2 to select the DMA and x can be 0 to 7 to select the DMA Stream. |
DMA_InitStruct | pointer to a DMA_InitTypeDef structure that contains the configuration information for the specified DMA Stream. |
- Return values
-
Definition at line 319 of file stm32f4xx_dma.c.
void DMA_PeriphIncOffsetSizeConfig |
( |
DMA_Stream_TypeDef * |
DMAy_Streamx, |
|
|
uint32_t |
DMA_Pincos |
|
) |
| |
Configures, when the PINC (Peripheral Increment address mode) bit is set, if the peripheral address should be incremented with the data size (configured with PSIZE bits) or by a fixed offset equal to 4 (32-bit aligned addresses).
- Note
- This function has no effect if the Peripheral Increment mode is disabled.
- Parameters
-
DMAy_Streamx | where y can be 1 or 2 to select the DMA and x can be 0 to 7 to select the DMA Stream. |
DMA_Pincos | specifies the Peripheral increment offset size. This parameter can be one of the following values:
- DMA_PINCOS_Psize: Peripheral address increment is done accordingly to PSIZE parameter.
- DMA_PINCOS_WordAligned: Peripheral address increment offset is fixed to 4 (32-bit aligned addresses).
|
- Return values
-
Definition at line 514 of file stm32f4xx_dma.c.
Fills each DMA_InitStruct member with its default value.
- Parameters
-
DMA_InitStruct | : pointer to a DMA_InitTypeDef structure which will be initialized. |
- Return values
-
- Parameters
-
DMA_InitStruct | pointer to a DMA_InitTypeDef structure which will be initialized. |
- Return values
-
Definition at line 403 of file stm32f4xx_dma.c.