Peripheral Control functions.
More...
Peripheral Control functions.
===============================================================================
##### Peripheral Control functions #####
===============================================================================
[..] This section provides functions allowing to:
(+) Configure the DMA2D foreground or background layer parameters.
(+) Configure the DMA2D CLUT transfer.
(+) Configure the line watermark
(+) Configure the dead time value.
(+) Enable or disable the dead time value functionality.
◆ HAL_DMA2D_ConfigCLUT()
Configure the DMA2D CLUT Transfer.
- Parameters
-
| hdma2d | Pointer to a DMA2D_HandleTypeDef structure that contains the configuration information for the DMA2D. |
| CLUTCfg | Pointer to a DMA2D_CLUTCfgTypeDef structure that contains the configuration information for the color look up table. |
| LayerIdx | DMA2D Layer index. This parameter can be one of the following values: DMA2D_BACKGROUND_LAYER(0) / DMA2D_FOREGROUND_LAYER(1) |
- Return values
-
Definition at line 1708 of file stm32l4xx_hal_dma2d.c.
1722 if(LayerIdx == DMA2D_BACKGROUND_LAYER)
1725 WRITE_REG(hdma2d->
Instance->BGCMAR, (uint32_t)CLUTCfg.
pCLUT);
1729 ((CLUTCfg.
Size << DMA2D_BGPFCCR_CS_Pos) | (CLUTCfg.
CLUTColorMode << DMA2D_BGPFCCR_CCM_Pos)));
1735 WRITE_REG(hdma2d->
Instance->FGCMAR, (uint32_t)CLUTCfg.
pCLUT);
1739 ((CLUTCfg.
Size << DMA2D_FGPFCCR_CS_Pos) | (CLUTCfg.
CLUTColorMode << DMA2D_FGPFCCR_CCM_Pos)));
__IO HAL_DMA2D_StateTypeDef State
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_DMA2D_ConfigDeadTime()
Configure dead time.
- Note
- The dead time value represents the guaranteed minimum number of cycles between two consecutive transactions on the AHB bus.
- Parameters
-
| hdma2d | DMA2D handle. |
| DeadTime | dead time value. |
- Return values
-
Definition at line 1849 of file stm32l4xx_hal_dma2d.c.
1857 MODIFY_REG(hdma2d->
Instance->AMTCR, DMA2D_AMTCR_DT, (((uint32_t) DeadTime) << DMA2D_AMTCR_DT_Pos));
__IO HAL_DMA2D_StateTypeDef State
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
◆ HAL_DMA2D_ConfigLayer()
Configure the DMA2D Layer according to the specified parameters in the DMA2D_HandleTypeDef.
- Parameters
-
| hdma2d | Pointer to a DMA2D_HandleTypeDef structure that contains the configuration information for the DMA2D. |
| LayerIdx | DMA2D Layer index. This parameter can be one of the following values: DMA2D_BACKGROUND_LAYER(0) / DMA2D_FOREGROUND_LAYER(1) |
- Return values
-
Definition at line 1614 of file stm32l4xx_hal_dma2d.c.
1617 uint32_t regMask, regValue;
1639 pLayerCfg = &hdma2d->
LayerCfg[LayerIdx];
1644 regMask = (DMA2D_BGPFCCR_CM | DMA2D_BGPFCCR_AM | DMA2D_BGPFCCR_ALPHA | DMA2D_BGPFCCR_AI | DMA2D_BGPFCCR_RBS);
1649 regValue |= (pLayerCfg->
InputAlpha & DMA2D_BGPFCCR_ALPHA);
1653 regValue |= (pLayerCfg->
InputAlpha << DMA2D_BGPFCCR_ALPHA_Pos);
1657 if(LayerIdx == DMA2D_BACKGROUND_LAYER)
1668 WRITE_REG(hdma2d->
Instance->BGCOLR, pLayerCfg->
InputAlpha & (DMA2D_BGCOLR_BLUE|DMA2D_BGCOLR_GREEN|DMA2D_BGCOLR_RED));
1685 WRITE_REG(hdma2d->
Instance->FGCOLR, pLayerCfg->
InputAlpha & (DMA2D_FGCOLR_BLUE|DMA2D_FGCOLR_GREEN|DMA2D_FGCOLR_RED));
DMA2D_LayerCfgTypeDef LayerCfg[MAX_DMA2D_LAYER]
DMA2D Layer structure definition.
__IO HAL_DMA2D_StateTypeDef State
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_DMA2D_DisableDeadTime()
Disable DMA2D dead time feature.
- Parameters
-
- Return values
-
Definition at line 1823 of file stm32l4xx_hal_dma2d.c.
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
__IO HAL_DMA2D_StateTypeDef State
◆ HAL_DMA2D_EnableDeadTime()
Enable DMA2D dead time feature.
- Parameters
-
- Return values
-
Definition at line 1800 of file stm32l4xx_hal_dma2d.c.
1808 SET_BIT(hdma2d->
Instance->AMTCR, DMA2D_AMTCR_EN);
__IO HAL_DMA2D_StateTypeDef State
◆ HAL_DMA2D_ProgramLineEvent()
Configure the line watermark.
- Parameters
-
| hdma2d | Pointer to a DMA2D_HandleTypeDef structure that contains the configuration information for the DMA2D. |
| Line | Line Watermark configuration (maximum 16-bit long value expected). |
- Note
- HAL_DMA2D_ProgramLineEvent() API enables the transfer watermark interrupt.
-
The transfer watermark interrupt is disabled once it has occurred.
- Return values
-
Definition at line 1762 of file stm32l4xx_hal_dma2d.c.
1767 if (Line > DMA2D_LWR_LW)
1780 WRITE_REG(hdma2d->
Instance->LWR, Line);
1783 __HAL_DMA2D_ENABLE_IT(hdma2d, DMA2D_IT_TW);
__IO HAL_DMA2D_StateTypeDef State
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))