STM8L15x Standard Peripherals Drivers
|
Initialization and Configuration functions. More...
Functions | |
void | DMA_Cmd (DMA_Channel_TypeDef *DMA_Channelx, FunctionalState NewState) |
Enables or disables the specified DMA Channelx. | |
void | DMA_DeInit (DMA_Channel_TypeDef *DMA_Channelx) |
Deinitializes the DMA Channelx registers to their default reset values. | |
void | DMA_GlobalCmd (FunctionalState NewState) |
Enables or disables All the DMA. | |
void | DMA_GlobalDeInit (void) |
Deinitializes the DMA Global Status register to its default reset values. | |
void | DMA_Init (DMA_Channel_TypeDef *DMA_Channelx, uint32_t DMA_Memory0BaseAddr, uint16_t DMA_PeripheralMemory1BaseAddr, uint8_t DMA_BufferSize, DMA_DIR_TypeDef DMA_DIR, DMA_Mode_TypeDef DMA_Mode, DMA_MemoryIncMode_TypeDef DMA_MemoryIncMode, DMA_Priority_TypeDef DMA_Priority, DMA_MemoryDataSize_TypeDef DMA_MemoryDataSize) |
Initializes the DMA Channelx according to the specified parameters. | |
void | DMA_SetTimeOut (uint8_t DMA_TimeOut) |
Sets the Time out Value. |
Detailed Description
Initialization and Configuration functions.
=============================================================================== 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. - All DMA channels can be enabled and disabled in the same time using DMA_GlobalCmd() function. - The DMA has 4 channels, User can enable or disable channels using DMA_Cmd() function. - The timeout duration (number of wait cycles starting from the latest request) is configured using DMA_SetTimeOut() function. The DMA then waits until this timeout has elapsed before requesting from the core a high priority access to the bus.
Function Documentation
void DMA_Cmd | ( | DMA_Channel_TypeDef * | DMA_Channelx, |
FunctionalState | NewState | ||
) |
Enables or disables the specified DMA Channelx.
- Note:
- DMA_GlobalCmd function must be called first to enable or disable the global DMA.
Definition at line 308 of file stm8l15x_dma.c.
References DMA_Channel_struct::CCR, DISABLE, DMA_CCR_CE, IS_DMA_CHANNEL, and IS_FUNCTIONAL_STATE.
void DMA_DeInit | ( | DMA_Channel_TypeDef * | DMA_Channelx | ) |
Deinitializes the DMA Channelx registers to their default reset values.
Definition at line 149 of file stm8l15x_dma.c.
References DMA_Channel_struct::CCR, DMA_Channel_struct::CM0ARH, DMA_Channel_struct::CM0ARL, DMA_Channel_struct::CM0EAR, DMA_Channel_struct::CNBTR, DMA_Channel_struct::CPARH, DMA_Channel_struct::CPARL, DMA_Channel_struct::CSPR, DMA1_Channel3, DMA_C3M0EAR_RESET_VALUE, DMA_C3PARH_RESET_VALUE, DMA_CCR_CE, DMA_CCR_RESET_VALUE, DMA_CM0ARH_RESET_VALUE, DMA_CM0ARL_RESET_VALUE, DMA_CNBTR_RESET_VALUE, DMA_CPARH_RESET_VALUE, DMA_CPARL_RESET_VALUE, DMA_CSPR_RESET_VALUE, and IS_DMA_CHANNEL.
void DMA_GlobalCmd | ( | FunctionalState | NewState | ) |
Enables or disables All the DMA.
Definition at line 282 of file stm8l15x_dma.c.
References DISABLE, DMA1, DMA_GCSR_GE, and IS_FUNCTIONAL_STATE.
void DMA_GlobalDeInit | ( | void | ) |
Deinitializes the DMA Global Status register to its default reset values.
Definition at line 134 of file stm8l15x_dma.c.
References DMA1, DMA_GCSR_GE, and DMA_GCSR_RESET_VALUE.
void DMA_Init | ( | DMA_Channel_TypeDef * | DMA_Channelx, |
uint32_t | DMA_Memory0BaseAddr, | ||
uint16_t | DMA_PeripheralMemory1BaseAddr, | ||
uint8_t | DMA_BufferSize, | ||
DMA_DIR_TypeDef | DMA_DIR, | ||
DMA_Mode_TypeDef | DMA_Mode, | ||
DMA_MemoryIncMode_TypeDef | DMA_MemoryIncMode, | ||
DMA_Priority_TypeDef | DMA_Priority, | ||
DMA_MemoryDataSize_TypeDef | DMA_MemoryDataSize | ||
) |
Initializes the DMA Channelx according to the specified parameters.
Definition at line 218 of file stm8l15x_dma.c.
References DMA_Channel_struct::CCR, DMA_Channel_struct::CM0ARH, DMA_Channel_struct::CM0ARL, DMA_Channel_struct::CM0EAR, DMA_Channel_struct::CNBTR, DMA_Channel_struct::CPARH, DMA_Channel_struct::CPARL, DMA_Channel_struct::CSPR, DMA1_Channel3, DMA_CCR_CE, DMA_CCR_RESET_VALUE, DMA_CSPR_16BM, DMA_CSPR_PL, IS_DMA_BUFFER_SIZE, IS_DMA_CHANNEL, IS_DMA_DIR, IS_DMA_MEMORY_INC_MODE, IS_DMA_MODE, and IS_DMA_PRIORITY.
void DMA_SetTimeOut | ( | uint8_t | DMA_TimeOut | ) |
Sets the Time out Value.
- Note:
- If timeout duration >0 (number of wait cycles starting from the latest request), the DMA waits until this timeout has elapsed before requesting from the core a high priority access to the bus.
- If timeout duration =0, there is no timeout and once a request is served, the DMA immediately asks to the CPU a high priority access to the bus.
Definition at line 336 of file stm8l15x_dma.c.
References DMA1, and IS_DMA_TIMEOUT.