STM32F4 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
Initialization and Configuration functions

Initialization and Configuration functions. More...

Functions

void DMA_DeInit (DMA_Stream_TypeDef *DMAy_Streamx)
 Deinitialize the DMAy Streamx registers to their default reset values. 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_StructInit (DMA_InitTypeDef *DMA_InitStruct)
 Fills each DMA_InitStruct member with its default value. More...
 
void DMA_Cmd (DMA_Stream_TypeDef *DMAy_Streamx, FunctionalState NewState)
 Enables or disables the specified DMAy Streamx. 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_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...
 

Detailed Description

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.

Function Documentation

void DMA_Cmd ( DMA_Stream_TypeDef *  DMAy_Streamx,
FunctionalState  NewState 
)

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
None
void DMA_DeInit ( DMA_Stream_TypeDef *  DMAy_Streamx)

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
None
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
None
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.

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
None
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
None
void DMA_StructInit ( DMA_InitTypeDef DMA_InitStruct)

Fills each DMA_InitStruct member with its default value.

Parameters
DMA_InitStruct: pointer to a DMA_InitTypeDef structure which will be initialized.
Return values
None