STM32L4xx_HAL_Driver  1.14.0
Peripheral Control functions

Peripheral Control functions. More...

Functions

HAL_StatusTypeDef HAL_LTDC_ConfigLayer (LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
 Configure the LTDC Layer according to the specified parameters in the LTDC_InitTypeDef and create the associated handle. More...
 
HAL_StatusTypeDef HAL_LTDC_SetWindowSize (LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx)
 Set the LTDC window size. More...
 
HAL_StatusTypeDef HAL_LTDC_SetWindowPosition (LTDC_HandleTypeDef *hltdc, uint32_t X0, uint32_t Y0, uint32_t LayerIdx)
 Set the LTDC window position. More...
 
HAL_StatusTypeDef HAL_LTDC_SetPixelFormat (LTDC_HandleTypeDef *hltdc, uint32_t Pixelformat, uint32_t LayerIdx)
 Reconfigure the pixel format. More...
 
HAL_StatusTypeDef HAL_LTDC_SetAlpha (LTDC_HandleTypeDef *hltdc, uint32_t Alpha, uint32_t LayerIdx)
 Reconfigure the layer alpha value. More...
 
HAL_StatusTypeDef HAL_LTDC_SetAddress (LTDC_HandleTypeDef *hltdc, uint32_t Address, uint32_t LayerIdx)
 Reconfigure the frame buffer Address. More...
 
HAL_StatusTypeDef HAL_LTDC_SetPitch (LTDC_HandleTypeDef *hltdc, uint32_t LinePitchInPixels, uint32_t LayerIdx)
 Function used to reconfigure the pitch for specific cases where the attached LayerIdx buffer have a width that is larger than the one intended to be displayed on screen. Example of a buffer 800x480 attached to layer for which we want to read and display on screen only a portion 320x240 taken in the center of the buffer. The pitch in pixels will be in that case 800 pixels and not 320 pixels as initially configured by previous call to HAL_LTDC_ConfigLayer(). More...
 
HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying (LTDC_HandleTypeDef *hltdc, uint32_t RGBValue, uint32_t LayerIdx)
 Configure the color keying. More...
 
HAL_StatusTypeDef HAL_LTDC_ConfigCLUT (LTDC_HandleTypeDef *hltdc, uint32_t *pCLUT, uint32_t CLUTSize, uint32_t LayerIdx)
 Load the color lookup table. More...
 
HAL_StatusTypeDef HAL_LTDC_EnableColorKeying (LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx)
 Enable the color keying. More...
 
HAL_StatusTypeDef HAL_LTDC_DisableColorKeying (LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx)
 Disable the color keying. More...
 
HAL_StatusTypeDef HAL_LTDC_EnableCLUT (LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx)
 Enable the color lookup table. More...
 
HAL_StatusTypeDef HAL_LTDC_DisableCLUT (LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx)
 Disable the color lookup table. More...
 
HAL_StatusTypeDef HAL_LTDC_ProgramLineEvent (LTDC_HandleTypeDef *hltdc, uint32_t Line)
 Define the position of the line interrupt. More...
 
HAL_StatusTypeDef HAL_LTDC_EnableDither (LTDC_HandleTypeDef *hltdc)
 Enable Dither. More...
 
HAL_StatusTypeDef HAL_LTDC_DisableDither (LTDC_HandleTypeDef *hltdc)
 Disable Dither. More...
 
HAL_StatusTypeDef HAL_LTDC_Reload (LTDC_HandleTypeDef *hltdc, uint32_t ReloadType)
 Reload LTDC Layers configuration. More...
 
HAL_StatusTypeDef HAL_LTDC_ConfigLayer_NoReload (LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
 Configure the LTDC Layer according to the specified without reloading parameters in the LTDC_InitTypeDef and create the associated handle. Variant of the function HAL_LTDC_ConfigLayer without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_SetWindowSize_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx)
 Set the LTDC window size without reloading. Variant of the function HAL_LTDC_SetWindowSize without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_SetWindowPosition_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t X0, uint32_t Y0, uint32_t LayerIdx)
 Set the LTDC window position without reloading. Variant of the function HAL_LTDC_SetWindowPosition without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_SetPixelFormat_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t Pixelformat, uint32_t LayerIdx)
 Reconfigure the pixel format without reloading. Variant of the function HAL_LTDC_SetPixelFormat without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_SetAlpha_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t Alpha, uint32_t LayerIdx)
 Reconfigure the layer alpha value without reloading. Variant of the function HAL_LTDC_SetAlpha without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_SetAddress_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t Address, uint32_t LayerIdx)
 Reconfigure the frame buffer Address without reloading. Variant of the function HAL_LTDC_SetAddress without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_SetPitch_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t LinePitchInPixels, uint32_t LayerIdx)
 Function used to reconfigure the pitch for specific cases where the attached LayerIdx buffer have a width that is larger than the one intended to be displayed on screen. Example of a buffer 800x480 attached to layer for which we want to read and display on screen only a portion 320x240 taken in the center of the buffer. The pitch in pixels will be in that case 800 pixels and not 320 pixels as initially configured by previous call to HAL_LTDC_ConfigLayer(). More...
 
HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t RGBValue, uint32_t LayerIdx)
 Configure the color keying without reloading. Variant of the function HAL_LTDC_ConfigColorKeying without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_EnableColorKeying_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx)
 Enable the color keying without reloading. Variant of the function HAL_LTDC_EnableColorKeying without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_DisableColorKeying_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx)
 Disable the color keying without reloading. Variant of the function HAL_LTDC_DisableColorKeying without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_EnableCLUT_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx)
 Enable the color lookup table without reloading. Variant of the function HAL_LTDC_EnableCLUT without immediate reload. More...
 
HAL_StatusTypeDef HAL_LTDC_DisableCLUT_NoReload (LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx)
 Disable the color lookup table without reloading. Variant of the function HAL_LTDC_DisableCLUT without immediate reload. More...
 

Detailed Description

Peripheral Control functions.

 ===============================================================================
                    ##### Peripheral Control functions #####
 ===============================================================================
    [..]  This section provides functions allowing to:
      (+) Configure the LTDC foreground or/and background parameters.
      (+) Set the active layer.
      (+) Configure the color keying.
      (+) Configure the C-LUT.
      (+) Enable / Disable the color keying.
      (+) Enable / Disable the C-LUT.
      (+) Update the layer position.
      (+) Update the layer size.
      (+) Update pixel format on the fly.
      (+) Update transparency on the fly.
      (+) Update address on the fly.

Function Documentation

◆ HAL_LTDC_ConfigCLUT()

HAL_StatusTypeDef HAL_LTDC_ConfigCLUT ( LTDC_HandleTypeDef hltdc,
uint32_t *  pCLUT,
uint32_t  CLUTSize,
uint32_t  LayerIdx 
)

Load the color lookup table.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
pCLUTpointer to the color lookup table address.
CLUTSizethe color lookup table size.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 872 of file stm32l4xx_hal_ltdc.c.

873 {
874  uint32_t tmp;
875  uint32_t counter;
876  uint32_t *pcolorlut = pCLUT;
877  /* Check the parameters */
878  assert_param(IS_LTDC_LAYER(LayerIdx));
879 
880  /* Process locked */
881  __HAL_LOCK(hltdc);
882 
883  /* Change LTDC peripheral state */
884  hltdc->State = HAL_LTDC_STATE_BUSY;
885 
886  for (counter = 0U; (counter < CLUTSize); counter++)
887  {
888  if (hltdc->LayerCfg[LayerIdx].PixelFormat == LTDC_PIXEL_FORMAT_AL44)
889  {
890  tmp = (((counter + (16U*counter)) << 24U) | ((uint32_t)(*pcolorlut) & 0xFFU) | ((uint32_t)(*pcolorlut) & 0xFF00U) | ((uint32_t)(*pcolorlut) & 0xFF0000U));
891  }
892  else
893  {
894  tmp = ((counter << 24U) | ((uint32_t)(*pcolorlut) & 0xFFU) | ((uint32_t)(*pcolorlut) & 0xFF00U) | ((uint32_t)(*pcolorlut) & 0xFF0000U));
895  }
896 
897  pcolorlut++;
898 
899  /* Specifies the C-LUT address and RGB value */
900  LTDC_LAYER(hltdc, LayerIdx)->CLUTWR = tmp;
901  }
902 
903  /* Change the LTDC state*/
904  hltdc->State = HAL_LTDC_STATE_READY;
905 
906  /* Process unlocked */
907  __HAL_UNLOCK(hltdc);
908 
909  return HAL_OK;
910 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_ConfigColorKeying()

HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying ( LTDC_HandleTypeDef hltdc,
uint32_t  RGBValue,
uint32_t  LayerIdx 
)

Configure the color keying.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
RGBValuethe color key value
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 834 of file stm32l4xx_hal_ltdc.c.

835 {
836  /* Check the parameters */
837  assert_param(IS_LTDC_LAYER(LayerIdx));
838 
839  /* Process locked */
840  __HAL_LOCK(hltdc);
841 
842  /* Change LTDC peripheral state */
843  hltdc->State = HAL_LTDC_STATE_BUSY;
844 
845  /* Configure the default color values */
846  LTDC_LAYER(hltdc, LayerIdx)->CKCR &= ~(LTDC_LxCKCR_CKBLUE | LTDC_LxCKCR_CKGREEN | LTDC_LxCKCR_CKRED);
847  LTDC_LAYER(hltdc, LayerIdx)->CKCR = RGBValue;
848 
849  /* Set the Immediate Reload type */
850  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
851 
852  /* Change the LTDC state*/
853  hltdc->State = HAL_LTDC_STATE_READY;
854 
855  /* Process unlocked */
856  __HAL_UNLOCK(hltdc);
857 
858  return HAL_OK;
859 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_ConfigColorKeying_NoReload()

HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  RGBValue,
uint32_t  LayerIdx 
)

Configure the color keying without reloading. Variant of the function HAL_LTDC_ConfigColorKeying without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
RGBValuethe color key value
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1857 of file stm32l4xx_hal_ltdc.c.

1858 {
1859  /* Check the parameters */
1860  assert_param(IS_LTDC_LAYER(LayerIdx));
1861 
1862  /* Process locked */
1863  __HAL_LOCK(hltdc);
1864 
1865  /* Change LTDC peripheral state */
1866  hltdc->State = HAL_LTDC_STATE_BUSY;
1867 
1868  /* Configure the default color values */
1869  LTDC_LAYER(hltdc, LayerIdx)->CKCR &= ~(LTDC_LxCKCR_CKBLUE | LTDC_LxCKCR_CKGREEN | LTDC_LxCKCR_CKRED);
1870  LTDC_LAYER(hltdc, LayerIdx)->CKCR = RGBValue;
1871 
1872  /* Change the LTDC state*/
1873  hltdc->State = HAL_LTDC_STATE_READY;
1874 
1875  /* Process unlocked */
1876  __HAL_UNLOCK(hltdc);
1877 
1878  return HAL_OK;
1879 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_ConfigLayer()

HAL_StatusTypeDef HAL_LTDC_ConfigLayer ( LTDC_HandleTypeDef hltdc,
LTDC_LayerCfgTypeDef pLayerCfg,
uint32_t  LayerIdx 
)

Configure the LTDC Layer according to the specified parameters in the LTDC_InitTypeDef and create the associated handle.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
pLayerCfgpointer to a LTDC_LayerCfgTypeDef structure that contains the configuration information for the Layer.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 784 of file stm32l4xx_hal_ltdc.c.

785 {
786  /* Check the parameters */
787  assert_param(IS_LTDC_LAYER(LayerIdx));
788  assert_param(IS_LTDC_HCONFIGST(pLayerCfg->WindowX0));
789  assert_param(IS_LTDC_HCONFIGSP(pLayerCfg->WindowX1));
790  assert_param(IS_LTDC_VCONFIGST(pLayerCfg->WindowY0));
791  assert_param(IS_LTDC_VCONFIGSP(pLayerCfg->WindowY1));
792  assert_param(IS_LTDC_PIXEL_FORMAT(pLayerCfg->PixelFormat));
793  assert_param(IS_LTDC_ALPHA(pLayerCfg->Alpha));
794  assert_param(IS_LTDC_ALPHA(pLayerCfg->Alpha0));
795  assert_param(IS_LTDC_BLENDING_FACTOR1(pLayerCfg->BlendingFactor1));
796  assert_param(IS_LTDC_BLENDING_FACTOR2(pLayerCfg->BlendingFactor2));
797  assert_param(IS_LTDC_CFBLL(pLayerCfg->ImageWidth));
798  assert_param(IS_LTDC_CFBLNBR(pLayerCfg->ImageHeight));
799 
800  /* Process locked */
801  __HAL_LOCK(hltdc);
802 
803  /* Change LTDC peripheral state */
804  hltdc->State = HAL_LTDC_STATE_BUSY;
805 
806  /* Copy new layer configuration into handle structure */
807  hltdc->LayerCfg[LayerIdx] = *pLayerCfg;
808 
809  /* Configure the LTDC Layer */
810  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
811 
812  /* Set the Immediate Reload type */
813  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
814 
815  /* Initialize the LTDC state*/
816  hltdc->State = HAL_LTDC_STATE_READY;
817 
818  /* Process unlocked */
819  __HAL_UNLOCK(hltdc);
820 
821  return HAL_OK;
822 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_ConfigLayer_NoReload()

HAL_StatusTypeDef HAL_LTDC_ConfigLayer_NoReload ( LTDC_HandleTypeDef hltdc,
LTDC_LayerCfgTypeDef pLayerCfg,
uint32_t  LayerIdx 
)

Configure the LTDC Layer according to the specified without reloading parameters in the LTDC_InitTypeDef and create the associated handle. Variant of the function HAL_LTDC_ConfigLayer without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
pLayerCfgpointer to a LTDC_LayerCfgTypeDef structure that contains the configuration information for the Layer.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1507 of file stm32l4xx_hal_ltdc.c.

1508 {
1509  /* Check the parameters */
1510  assert_param(IS_LTDC_LAYER(LayerIdx));
1511  assert_param(IS_LTDC_HCONFIGST(pLayerCfg->WindowX0));
1512  assert_param(IS_LTDC_HCONFIGSP(pLayerCfg->WindowX1));
1513  assert_param(IS_LTDC_VCONFIGST(pLayerCfg->WindowY0));
1514  assert_param(IS_LTDC_VCONFIGSP(pLayerCfg->WindowY1));
1515  assert_param(IS_LTDC_PIXEL_FORMAT(pLayerCfg->PixelFormat));
1516  assert_param(IS_LTDC_ALPHA(pLayerCfg->Alpha));
1517  assert_param(IS_LTDC_ALPHA(pLayerCfg->Alpha0));
1518  assert_param(IS_LTDC_BLENDING_FACTOR1(pLayerCfg->BlendingFactor1));
1519  assert_param(IS_LTDC_BLENDING_FACTOR2(pLayerCfg->BlendingFactor2));
1520  assert_param(IS_LTDC_CFBLL(pLayerCfg->ImageWidth));
1521  assert_param(IS_LTDC_CFBLNBR(pLayerCfg->ImageHeight));
1522 
1523  /* Process locked */
1524  __HAL_LOCK(hltdc);
1525 
1526  /* Change LTDC peripheral state */
1527  hltdc->State = HAL_LTDC_STATE_BUSY;
1528 
1529  /* Copy new layer configuration into handle structure */
1530  hltdc->LayerCfg[LayerIdx] = *pLayerCfg;
1531 
1532  /* Configure the LTDC Layer */
1533  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1534 
1535  /* Initialize the LTDC state*/
1536  hltdc->State = HAL_LTDC_STATE_READY;
1537 
1538  /* Process unlocked */
1539  __HAL_UNLOCK(hltdc);
1540 
1541  return HAL_OK;
1542 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_DisableCLUT()

HAL_StatusTypeDef HAL_LTDC_DisableCLUT ( LTDC_HandleTypeDef hltdc,
uint32_t  LayerIdx 
)

Disable the color lookup table.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1026 of file stm32l4xx_hal_ltdc.c.

1027 {
1028  /* Check the parameters */
1029  assert_param(IS_LTDC_LAYER(LayerIdx));
1030 
1031  /* Process locked */
1032  __HAL_LOCK(hltdc);
1033 
1034  /* Change LTDC peripheral state */
1035  hltdc->State = HAL_LTDC_STATE_BUSY;
1036 
1037  /* Disable LTDC color lookup table by setting CLUTEN bit */
1038  LTDC_LAYER(hltdc, LayerIdx)->CR &= ~(uint32_t)LTDC_LxCR_CLUTEN;
1039 
1040  /* Set the Immediate Reload type */
1041  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
1042 
1043  /* Change the LTDC state*/
1044  hltdc->State = HAL_LTDC_STATE_READY;
1045 
1046  /* Process unlocked */
1047  __HAL_UNLOCK(hltdc);
1048 
1049  return HAL_OK;
1050 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_DisableCLUT_NoReload()

HAL_StatusTypeDef HAL_LTDC_DisableCLUT_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  LayerIdx 
)

Disable the color lookup table without reloading. Variant of the function HAL_LTDC_DisableCLUT without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1990 of file stm32l4xx_hal_ltdc.c.

1991 {
1992  /* Check the parameters */
1993  assert_param(IS_LTDC_LAYER(LayerIdx));
1994 
1995  /* Process locked */
1996  __HAL_LOCK(hltdc);
1997 
1998  /* Change LTDC peripheral state */
1999  hltdc->State = HAL_LTDC_STATE_BUSY;
2000 
2001  /* Disable LTDC color lookup table by setting CLUTEN bit */
2002  LTDC_LAYER(hltdc, LayerIdx)->CR &= ~(uint32_t)LTDC_LxCR_CLUTEN;
2003 
2004  /* Change the LTDC state*/
2005  hltdc->State = HAL_LTDC_STATE_READY;
2006 
2007  /* Process unlocked */
2008  __HAL_UNLOCK(hltdc);
2009 
2010  return HAL_OK;
2011 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_DisableColorKeying()

HAL_StatusTypeDef HAL_LTDC_DisableColorKeying ( LTDC_HandleTypeDef hltdc,
uint32_t  LayerIdx 
)

Disable the color keying.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 956 of file stm32l4xx_hal_ltdc.c.

957 {
958  /* Check the parameters */
959  assert_param(IS_LTDC_LAYER(LayerIdx));
960 
961  /* Process locked */
962  __HAL_LOCK(hltdc);
963 
964  /* Change LTDC peripheral state */
965  hltdc->State = HAL_LTDC_STATE_BUSY;
966 
967  /* Disable LTDC color keying by setting COLKEN bit */
968  LTDC_LAYER(hltdc, LayerIdx)->CR &= ~(uint32_t)LTDC_LxCR_COLKEN;
969 
970  /* Set the Immediate Reload type */
971  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
972 
973  /* Change the LTDC state*/
974  hltdc->State = HAL_LTDC_STATE_READY;
975 
976  /* Process unlocked */
977  __HAL_UNLOCK(hltdc);
978 
979  return HAL_OK;
980 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_DisableColorKeying_NoReload()

HAL_StatusTypeDef HAL_LTDC_DisableColorKeying_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  LayerIdx 
)

Disable the color keying without reloading. Variant of the function HAL_LTDC_DisableColorKeying without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1924 of file stm32l4xx_hal_ltdc.c.

1925 {
1926  /* Check the parameters */
1927  assert_param(IS_LTDC_LAYER(LayerIdx));
1928 
1929  /* Process locked */
1930  __HAL_LOCK(hltdc);
1931 
1932  /* Change LTDC peripheral state */
1933  hltdc->State = HAL_LTDC_STATE_BUSY;
1934 
1935  /* Disable LTDC color keying by setting COLKEN bit */
1936  LTDC_LAYER(hltdc, LayerIdx)->CR &= ~(uint32_t)LTDC_LxCR_COLKEN;
1937 
1938  /* Change the LTDC state*/
1939  hltdc->State = HAL_LTDC_STATE_READY;
1940 
1941  /* Process unlocked */
1942  __HAL_UNLOCK(hltdc);
1943 
1944  return HAL_OK;
1945 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_DisableDither()

HAL_StatusTypeDef HAL_LTDC_DisableDither ( LTDC_HandleTypeDef hltdc)

Disable Dither.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
Return values
HALstatus

Definition at line 1086 of file stm32l4xx_hal_ltdc.c.

1087 {
1088  /* Process locked */
1089  __HAL_LOCK(hltdc);
1090 
1091  /* Change LTDC peripheral state */
1092  hltdc->State = HAL_LTDC_STATE_BUSY;
1093 
1094  /* Disable Dither by setting DTEN bit */
1095  LTDC->GCR &= ~(uint32_t)LTDC_GCR_DEN;
1096 
1097  /* Change the LTDC state*/
1098  hltdc->State = HAL_LTDC_STATE_READY;
1099 
1100  /* Process unlocked */
1101  __HAL_UNLOCK(hltdc);
1102 
1103  return HAL_OK;
1104 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK

◆ HAL_LTDC_EnableCLUT()

HAL_StatusTypeDef HAL_LTDC_EnableCLUT ( LTDC_HandleTypeDef hltdc,
uint32_t  LayerIdx 
)

Enable the color lookup table.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 991 of file stm32l4xx_hal_ltdc.c.

992 {
993  /* Check the parameters */
994  assert_param(IS_LTDC_LAYER(LayerIdx));
995 
996  /* Process locked */
997  __HAL_LOCK(hltdc);
998 
999  /* Change LTDC peripheral state */
1000  hltdc->State = HAL_LTDC_STATE_BUSY;
1001 
1002  /* Enable LTDC color lookup table by setting CLUTEN bit */
1003  LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_CLUTEN;
1004 
1005  /* Set the Immediate Reload type */
1006  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
1007 
1008  /* Change the LTDC state*/
1009  hltdc->State = HAL_LTDC_STATE_READY;
1010 
1011  /* Process unlocked */
1012  __HAL_UNLOCK(hltdc);
1013 
1014  return HAL_OK;
1015 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_EnableCLUT_NoReload()

HAL_StatusTypeDef HAL_LTDC_EnableCLUT_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  LayerIdx 
)

Enable the color lookup table without reloading. Variant of the function HAL_LTDC_EnableCLUT without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1957 of file stm32l4xx_hal_ltdc.c.

1958 {
1959  /* Check the parameters */
1960  assert_param(IS_LTDC_LAYER(LayerIdx));
1961 
1962  /* Process locked */
1963  __HAL_LOCK(hltdc);
1964 
1965  /* Change LTDC peripheral state */
1966  hltdc->State = HAL_LTDC_STATE_BUSY;
1967 
1968  /* Disable LTDC color lookup table by setting CLUTEN bit */
1969  LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_CLUTEN;
1970 
1971  /* Change the LTDC state*/
1972  hltdc->State = HAL_LTDC_STATE_READY;
1973 
1974  /* Process unlocked */
1975  __HAL_UNLOCK(hltdc);
1976 
1977  return HAL_OK;
1978 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_EnableColorKeying()

HAL_StatusTypeDef HAL_LTDC_EnableColorKeying ( LTDC_HandleTypeDef hltdc,
uint32_t  LayerIdx 
)

Enable the color keying.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 921 of file stm32l4xx_hal_ltdc.c.

922 {
923  /* Check the parameters */
924  assert_param(IS_LTDC_LAYER(LayerIdx));
925 
926  /* Process locked */
927  __HAL_LOCK(hltdc);
928 
929  /* Change LTDC peripheral state */
930  hltdc->State = HAL_LTDC_STATE_BUSY;
931 
932  /* Enable LTDC color keying by setting COLKEN bit */
933  LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_COLKEN;
934 
935  /* Set the Immediate Reload type */
936  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
937 
938  /* Change the LTDC state*/
939  hltdc->State = HAL_LTDC_STATE_READY;
940 
941  /* Process unlocked */
942  __HAL_UNLOCK(hltdc);
943 
944  return HAL_OK;
945 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_EnableColorKeying_NoReload()

HAL_StatusTypeDef HAL_LTDC_EnableColorKeying_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  LayerIdx 
)

Enable the color keying without reloading. Variant of the function HAL_LTDC_EnableColorKeying without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1891 of file stm32l4xx_hal_ltdc.c.

1892 {
1893  /* Check the parameters */
1894  assert_param(IS_LTDC_LAYER(LayerIdx));
1895 
1896  /* Process locked */
1897  __HAL_LOCK(hltdc);
1898 
1899  /* Change LTDC peripheral state */
1900  hltdc->State = HAL_LTDC_STATE_BUSY;
1901 
1902  /* Enable LTDC color keying by setting COLKEN bit */
1903  LTDC_LAYER(hltdc, LayerIdx)->CR |= (uint32_t)LTDC_LxCR_COLKEN;
1904 
1905  /* Change the LTDC state*/
1906  hltdc->State = HAL_LTDC_STATE_READY;
1907 
1908  /* Process unlocked */
1909  __HAL_UNLOCK(hltdc);
1910 
1911  return HAL_OK;
1912 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_EnableDither()

HAL_StatusTypeDef HAL_LTDC_EnableDither ( LTDC_HandleTypeDef hltdc)

Enable Dither.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
Return values
HALstatus

Definition at line 1059 of file stm32l4xx_hal_ltdc.c.

1060 {
1061  /* Process locked */
1062  __HAL_LOCK(hltdc);
1063 
1064  /* Change LTDC peripheral state */
1065  hltdc->State = HAL_LTDC_STATE_BUSY;
1066 
1067  /* Enable Dither by setting DTEN bit */
1068  LTDC->GCR |= (uint32_t)LTDC_GCR_DEN;
1069 
1070  /* Change the LTDC state*/
1071  hltdc->State = HAL_LTDC_STATE_READY;
1072 
1073  /* Process unlocked */
1074  __HAL_UNLOCK(hltdc);
1075 
1076  return HAL_OK;
1077 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK

◆ HAL_LTDC_ProgramLineEvent()

HAL_StatusTypeDef HAL_LTDC_ProgramLineEvent ( LTDC_HandleTypeDef hltdc,
uint32_t  Line 
)

Define the position of the line interrupt.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LineLine Interrupt Position.
Note
User application may resort to HAL_LTDC_LineEventCallback() at line interrupt generation.
Return values
HALstatus

Definition at line 1429 of file stm32l4xx_hal_ltdc.c.

1430 {
1431  /* Check the parameters */
1432  assert_param(IS_LTDC_LIPOS(Line));
1433 
1434  /* Process locked */
1435  __HAL_LOCK(hltdc);
1436 
1437  /* Change LTDC peripheral state */
1438  hltdc->State = HAL_LTDC_STATE_BUSY;
1439 
1440  /* Disable the Line interrupt */
1441  __HAL_LTDC_DISABLE_IT(hltdc, LTDC_IT_LI);
1442 
1443  /* Set the Line Interrupt position */
1444  LTDC->LIPCR = (uint32_t)Line;
1445 
1446  /* Enable the Line interrupt */
1447  __HAL_LTDC_ENABLE_IT(hltdc, LTDC_IT_LI);
1448 
1449  /* Change the LTDC state*/
1450  hltdc->State = HAL_LTDC_STATE_READY;
1451 
1452  /* Process unlocked */
1453  __HAL_UNLOCK(hltdc);
1454 
1455  return HAL_OK;
1456 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_Reload()

HAL_StatusTypeDef HAL_LTDC_Reload ( LTDC_HandleTypeDef hltdc,
uint32_t  ReloadType 
)

Reload LTDC Layers configuration.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
ReloadTypeThis parameter can be one of the following values : LTDC_RELOAD_IMMEDIATE : Immediate Reload LTDC_RELOAD_VERTICAL_BLANKING : Reload in the next Vertical Blanking
Note
User application may resort to HAL_LTDC_ReloadEventCallback() at reload interrupt generation.
Return values
HALstatus

Definition at line 1468 of file stm32l4xx_hal_ltdc.c.

1469 {
1470  /* Check the parameters */
1471  assert_param(IS_LTDC_RELOAD(ReloadType));
1472 
1473  /* Process locked */
1474  __HAL_LOCK(hltdc);
1475 
1476  /* Change LTDC peripheral state */
1477  hltdc->State = HAL_LTDC_STATE_BUSY;
1478 
1479  /* Enable the Reload interrupt */
1480  __HAL_LTDC_ENABLE_IT(hltdc, LTDC_IT_RR);
1481 
1482  /* Apply Reload type */
1483  hltdc->Instance->SRCR = ReloadType;
1484 
1485  /* Change the LTDC state*/
1486  hltdc->State = HAL_LTDC_STATE_READY;
1487 
1488  /* Process unlocked */
1489  __HAL_UNLOCK(hltdc);
1490 
1491  return HAL_OK;
1492 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetAddress()

HAL_StatusTypeDef HAL_LTDC_SetAddress ( LTDC_HandleTypeDef hltdc,
uint32_t  Address,
uint32_t  LayerIdx 
)

Reconfigure the frame buffer Address.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
Addressnew address value.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
Return values
HALstatus

Definition at line 1313 of file stm32l4xx_hal_ltdc.c.

1314 {
1315  LTDC_LayerCfgTypeDef *pLayerCfg;
1316 
1317  /* Check the parameters */
1318  assert_param(IS_LTDC_LAYER(LayerIdx));
1319 
1320  /* Process locked */
1321  __HAL_LOCK(hltdc);
1322 
1323  /* Change LTDC peripheral state */
1324  hltdc->State = HAL_LTDC_STATE_BUSY;
1325 
1326  /* Get layer configuration from handle structure */
1327  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1328 
1329  /* Reconfigure the Address */
1330  pLayerCfg->FBStartAdress = Address;
1331 
1332  /* Set LTDC parameters */
1333  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1334 
1335  /* Set the Immediate Reload type */
1336  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
1337 
1338  /* Change the LTDC state*/
1339  hltdc->State = HAL_LTDC_STATE_READY;
1340 
1341  /* Process unlocked */
1342  __HAL_UNLOCK(hltdc);
1343 
1344  return HAL_OK;
1345 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetAddress_NoReload()

HAL_StatusTypeDef HAL_LTDC_SetAddress_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  Address,
uint32_t  LayerIdx 
)

Reconfigure the frame buffer Address without reloading. Variant of the function HAL_LTDC_SetAddress without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
Addressnew address value.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
Return values
HALstatus

Definition at line 1745 of file stm32l4xx_hal_ltdc.c.

1746 {
1747  LTDC_LayerCfgTypeDef *pLayerCfg;
1748 
1749  /* Check the parameters */
1750  assert_param(IS_LTDC_LAYER(LayerIdx));
1751 
1752  /* Process locked */
1753  __HAL_LOCK(hltdc);
1754 
1755  /* Change LTDC peripheral state */
1756  hltdc->State = HAL_LTDC_STATE_BUSY;
1757 
1758  /* Get layer configuration from handle structure */
1759  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1760 
1761  /* Reconfigure the Address */
1762  pLayerCfg->FBStartAdress = Address;
1763 
1764  /* Set LTDC parameters */
1765  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1766 
1767  /* Change the LTDC state*/
1768  hltdc->State = HAL_LTDC_STATE_READY;
1769 
1770  /* Process unlocked */
1771  __HAL_UNLOCK(hltdc);
1772 
1773  return HAL_OK;
1774 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetAlpha()

HAL_StatusTypeDef HAL_LTDC_SetAlpha ( LTDC_HandleTypeDef hltdc,
uint32_t  Alpha,
uint32_t  LayerIdx 
)

Reconfigure the layer alpha value.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
Alphanew alpha value.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1269 of file stm32l4xx_hal_ltdc.c.

1270 {
1271  LTDC_LayerCfgTypeDef *pLayerCfg;
1272 
1273  /* Check the parameters */
1274  assert_param(IS_LTDC_ALPHA(Alpha));
1275  assert_param(IS_LTDC_LAYER(LayerIdx));
1276 
1277  /* Process locked */
1278  __HAL_LOCK(hltdc);
1279 
1280  /* Change LTDC peripheral state */
1281  hltdc->State = HAL_LTDC_STATE_BUSY;
1282 
1283  /* Get layer configuration from handle structure */
1284  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1285 
1286  /* Reconfigure the Alpha value */
1287  pLayerCfg->Alpha = Alpha;
1288 
1289  /* Set LTDC parameters */
1290  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1291 
1292  /* Set the Immediate Reload type */
1293  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
1294 
1295  /* Change the LTDC state*/
1296  hltdc->State = HAL_LTDC_STATE_READY;
1297 
1298  /* Process unlocked */
1299  __HAL_UNLOCK(hltdc);
1300 
1301  return HAL_OK;
1302 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetAlpha_NoReload()

HAL_StatusTypeDef HAL_LTDC_SetAlpha_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  Alpha,
uint32_t  LayerIdx 
)

Reconfigure the layer alpha value without reloading. Variant of the function HAL_LTDC_SetAlpha without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
Alphanew alpha value.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1702 of file stm32l4xx_hal_ltdc.c.

1703 {
1704  LTDC_LayerCfgTypeDef *pLayerCfg;
1705 
1706  /* Check the parameters */
1707  assert_param(IS_LTDC_ALPHA(Alpha));
1708  assert_param(IS_LTDC_LAYER(LayerIdx));
1709 
1710  /* Process locked */
1711  __HAL_LOCK(hltdc);
1712 
1713  /* Change LTDC peripheral state */
1714  hltdc->State = HAL_LTDC_STATE_BUSY;
1715 
1716  /* Get layer configuration from handle structure */
1717  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1718 
1719  /* Reconfigure the Alpha value */
1720  pLayerCfg->Alpha = Alpha;
1721 
1722  /* Set LTDC parameters */
1723  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1724 
1725  /* Change the LTDC state*/
1726  hltdc->State = HAL_LTDC_STATE_READY;
1727 
1728  /* Process unlocked */
1729  __HAL_UNLOCK(hltdc);
1730 
1731  return HAL_OK;
1732 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetPitch()

HAL_StatusTypeDef HAL_LTDC_SetPitch ( LTDC_HandleTypeDef hltdc,
uint32_t  LinePitchInPixels,
uint32_t  LayerIdx 
)

Function used to reconfigure the pitch for specific cases where the attached LayerIdx buffer have a width that is larger than the one intended to be displayed on screen. Example of a buffer 800x480 attached to layer for which we want to read and display on screen only a portion 320x240 taken in the center of the buffer. The pitch in pixels will be in that case 800 pixels and not 320 pixels as initially configured by previous call to HAL_LTDC_ConfigLayer().

Note
This function should be called only after a previous call to HAL_LTDC_ConfigLayer() to modify the default pitch configured by HAL_LTDC_ConfigLayer() when required (refer to example described just above).
Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LinePitchInPixelsNew line pitch in pixels to configure for LTDC layer 'LayerIdx'.
LayerIdxLTDC layer index concerned by the modification of line pitch.
Return values
HALstatus

Definition at line 1360 of file stm32l4xx_hal_ltdc.c.

1361 {
1362  uint32_t tmp;
1363  uint32_t pitchUpdate;
1364  uint32_t pixelFormat;
1365 
1366  /* Check the parameters */
1367  assert_param(IS_LTDC_LAYER(LayerIdx));
1368 
1369  /* Process locked */
1370  __HAL_LOCK(hltdc);
1371 
1372  /* Change LTDC peripheral state */
1373  hltdc->State = HAL_LTDC_STATE_BUSY;
1374 
1375  /* get LayerIdx used pixel format */
1376  pixelFormat = hltdc->LayerCfg[LayerIdx].PixelFormat;
1377 
1378  if (pixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
1379  {
1380  tmp = 4U;
1381  }
1382  else if (pixelFormat == LTDC_PIXEL_FORMAT_RGB888)
1383  {
1384  tmp = 3U;
1385  }
1386  else if ((pixelFormat == LTDC_PIXEL_FORMAT_ARGB4444) || \
1387  (pixelFormat == LTDC_PIXEL_FORMAT_RGB565) || \
1388  (pixelFormat == LTDC_PIXEL_FORMAT_ARGB1555) || \
1389  (pixelFormat == LTDC_PIXEL_FORMAT_AL88))
1390  {
1391  tmp = 2U;
1392  }
1393  else
1394  {
1395  tmp = 1U;
1396  }
1397 
1398  pitchUpdate = ((LinePitchInPixels * tmp) << 16U);
1399 
1400  /* Clear previously set standard pitch */
1401  LTDC_LAYER(hltdc, LayerIdx)->CFBLR &= ~LTDC_LxCFBLR_CFBP;
1402 
1403  /* Set the Reload type as immediate update of LTDC pitch configured above */
1404  LTDC->SRCR |= LTDC_SRCR_IMR;
1405 
1406  /* Set new line pitch value */
1407  LTDC_LAYER(hltdc, LayerIdx)->CFBLR |= pitchUpdate;
1408 
1409  /* Set the Reload type as immediate update of LTDC pitch configured above */
1410  LTDC->SRCR |= LTDC_SRCR_IMR;
1411 
1412  /* Change the LTDC state*/
1413  hltdc->State = HAL_LTDC_STATE_READY;
1414 
1415  /* Process unlocked */
1416  __HAL_UNLOCK(hltdc);
1417 
1418  return HAL_OK;
1419 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetPitch_NoReload()

HAL_StatusTypeDef HAL_LTDC_SetPitch_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  LinePitchInPixels,
uint32_t  LayerIdx 
)

Function used to reconfigure the pitch for specific cases where the attached LayerIdx buffer have a width that is larger than the one intended to be displayed on screen. Example of a buffer 800x480 attached to layer for which we want to read and display on screen only a portion 320x240 taken in the center of the buffer. The pitch in pixels will be in that case 800 pixels and not 320 pixels as initially configured by previous call to HAL_LTDC_ConfigLayer().

Note
This function should be called only after a previous call to HAL_LTDC_ConfigLayer() to modify the default pitch configured by HAL_LTDC_ConfigLayer() when required (refer to example described just above). Variant of the function HAL_LTDC_SetPitch without immediate reload.
Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
LinePitchInPixelsNew line pitch in pixels to configure for LTDC layer 'LayerIdx'.
LayerIdxLTDC layer index concerned by the modification of line pitch.
Return values
HALstatus

Definition at line 1790 of file stm32l4xx_hal_ltdc.c.

1791 {
1792  uint32_t tmp;
1793  uint32_t pitchUpdate;
1794  uint32_t pixelFormat;
1795 
1796  /* Check the parameters */
1797  assert_param(IS_LTDC_LAYER(LayerIdx));
1798 
1799  /* Process locked */
1800  __HAL_LOCK(hltdc);
1801 
1802  /* Change LTDC peripheral state */
1803  hltdc->State = HAL_LTDC_STATE_BUSY;
1804 
1805  /* get LayerIdx used pixel format */
1806  pixelFormat = hltdc->LayerCfg[LayerIdx].PixelFormat;
1807 
1808  if (pixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
1809  {
1810  tmp = 4U;
1811  }
1812  else if (pixelFormat == LTDC_PIXEL_FORMAT_RGB888)
1813  {
1814  tmp = 3U;
1815  }
1816  else if ((pixelFormat == LTDC_PIXEL_FORMAT_ARGB4444) || \
1817  (pixelFormat == LTDC_PIXEL_FORMAT_RGB565) || \
1818  (pixelFormat == LTDC_PIXEL_FORMAT_ARGB1555) || \
1819  (pixelFormat == LTDC_PIXEL_FORMAT_AL88))
1820  {
1821  tmp = 2U;
1822  }
1823  else
1824  {
1825  tmp = 1U;
1826  }
1827 
1828  pitchUpdate = ((LinePitchInPixels * tmp) << 16U);
1829 
1830  /* Clear previously set standard pitch */
1831  LTDC_LAYER(hltdc, LayerIdx)->CFBLR &= ~LTDC_LxCFBLR_CFBP;
1832 
1833  /* Set new line pitch value */
1834  LTDC_LAYER(hltdc, LayerIdx)->CFBLR |= pitchUpdate;
1835 
1836  /* Change the LTDC state*/
1837  hltdc->State = HAL_LTDC_STATE_READY;
1838 
1839  /* Process unlocked */
1840  __HAL_UNLOCK(hltdc);
1841 
1842  return HAL_OK;
1843 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetPixelFormat()

HAL_StatusTypeDef HAL_LTDC_SetPixelFormat ( LTDC_HandleTypeDef hltdc,
uint32_t  Pixelformat,
uint32_t  LayerIdx 
)

Reconfigure the pixel format.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
Pixelformatnew pixel format value.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
Return values
HALstatus

Definition at line 1224 of file stm32l4xx_hal_ltdc.c.

1225 {
1226  LTDC_LayerCfgTypeDef *pLayerCfg;
1227 
1228  /* Check the parameters */
1229  assert_param(IS_LTDC_PIXEL_FORMAT(Pixelformat));
1230  assert_param(IS_LTDC_LAYER(LayerIdx));
1231 
1232  /* Process locked */
1233  __HAL_LOCK(hltdc);
1234 
1235  /* Change LTDC peripheral state */
1236  hltdc->State = HAL_LTDC_STATE_BUSY;
1237 
1238  /* Get layer configuration from handle structure */
1239  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1240 
1241  /* Reconfigure the pixel format */
1242  pLayerCfg->PixelFormat = Pixelformat;
1243 
1244  /* Set LTDC parameters */
1245  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1246 
1247  /* Set the Immediate Reload type */
1248  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
1249 
1250  /* Change the LTDC state*/
1251  hltdc->State = HAL_LTDC_STATE_READY;
1252 
1253  /* Process unlocked */
1254  __HAL_UNLOCK(hltdc);
1255 
1256  return HAL_OK;
1257 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetPixelFormat_NoReload()

HAL_StatusTypeDef HAL_LTDC_SetPixelFormat_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  Pixelformat,
uint32_t  LayerIdx 
)

Reconfigure the pixel format without reloading. Variant of the function HAL_LTDC_SetPixelFormat without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDfef structure that contains the configuration information for the LTDC.
Pixelformatnew pixel format value.
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
Return values
HALstatus

Definition at line 1659 of file stm32l4xx_hal_ltdc.c.

1660 {
1661  LTDC_LayerCfgTypeDef *pLayerCfg;
1662 
1663  /* Check the parameters */
1664  assert_param(IS_LTDC_PIXEL_FORMAT(Pixelformat));
1665  assert_param(IS_LTDC_LAYER(LayerIdx));
1666 
1667  /* Process locked */
1668  __HAL_LOCK(hltdc);
1669 
1670  /* Change LTDC peripheral state */
1671  hltdc->State = HAL_LTDC_STATE_BUSY;
1672 
1673  /* Get layer configuration from handle structure */
1674  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1675 
1676  /* Reconfigure the pixel format */
1677  pLayerCfg->PixelFormat = Pixelformat;
1678 
1679  /* Set LTDC parameters */
1680  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1681 
1682  /* Change the LTDC state*/
1683  hltdc->State = HAL_LTDC_STATE_READY;
1684 
1685  /* Process unlocked */
1686  __HAL_UNLOCK(hltdc);
1687 
1688  return HAL_OK;
1689 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetWindowPosition()

HAL_StatusTypeDef HAL_LTDC_SetWindowPosition ( LTDC_HandleTypeDef hltdc,
uint32_t  X0,
uint32_t  Y0,
uint32_t  LayerIdx 
)

Set the LTDC window position.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
X0LTDC window X offset
Y0LTDC window Y offset
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1173 of file stm32l4xx_hal_ltdc.c.

1174 {
1175  LTDC_LayerCfgTypeDef *pLayerCfg;
1176 
1177  /* Check the parameters */
1178  assert_param(IS_LTDC_LAYER(LayerIdx));
1179  assert_param(IS_LTDC_CFBLL(X0));
1180  assert_param(IS_LTDC_CFBLNBR(Y0));
1181 
1182  /* Process locked */
1183  __HAL_LOCK(hltdc);
1184 
1185  /* Change LTDC peripheral state */
1186  hltdc->State = HAL_LTDC_STATE_BUSY;
1187 
1188  /* Get layer configuration from handle structure */
1189  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1190 
1191  /* update horizontal start/stop */
1192  pLayerCfg->WindowX0 = X0;
1193  pLayerCfg->WindowX1 = X0 + pLayerCfg->ImageWidth;
1194 
1195  /* update vertical start/stop */
1196  pLayerCfg->WindowY0 = Y0;
1197  pLayerCfg->WindowY1 = Y0 + pLayerCfg->ImageHeight;
1198 
1199  /* Set LTDC parameters */
1200  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1201 
1202  /* Set the Immediate Reload type */
1203  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
1204 
1205  /* Change the LTDC state*/
1206  hltdc->State = HAL_LTDC_STATE_READY;
1207 
1208  /* Process unlocked */
1209  __HAL_UNLOCK(hltdc);
1210 
1211  return HAL_OK;
1212 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetWindowPosition_NoReload()

HAL_StatusTypeDef HAL_LTDC_SetWindowPosition_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  X0,
uint32_t  Y0,
uint32_t  LayerIdx 
)

Set the LTDC window position without reloading. Variant of the function HAL_LTDC_SetWindowPosition without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
X0LTDC window X offset
Y0LTDC window Y offset
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1610 of file stm32l4xx_hal_ltdc.c.

1611 {
1612  LTDC_LayerCfgTypeDef *pLayerCfg;
1613 
1614  /* Check the parameters */
1615  assert_param(IS_LTDC_LAYER(LayerIdx));
1616  assert_param(IS_LTDC_CFBLL(X0));
1617  assert_param(IS_LTDC_CFBLNBR(Y0));
1618 
1619  /* Process locked */
1620  __HAL_LOCK(hltdc);
1621 
1622  /* Change LTDC peripheral state */
1623  hltdc->State = HAL_LTDC_STATE_BUSY;
1624 
1625  /* Get layer configuration from handle structure */
1626  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1627 
1628  /* update horizontal start/stop */
1629  pLayerCfg->WindowX0 = X0;
1630  pLayerCfg->WindowX1 = X0 + pLayerCfg->ImageWidth;
1631 
1632  /* update vertical start/stop */
1633  pLayerCfg->WindowY0 = Y0;
1634  pLayerCfg->WindowY1 = Y0 + pLayerCfg->ImageHeight;
1635 
1636  /* Set LTDC parameters */
1637  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1638 
1639  /* Change the LTDC state*/
1640  hltdc->State = HAL_LTDC_STATE_READY;
1641 
1642  /* Process unlocked */
1643  __HAL_UNLOCK(hltdc);
1644 
1645  return HAL_OK;
1646 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetWindowSize()

HAL_StatusTypeDef HAL_LTDC_SetWindowSize ( LTDC_HandleTypeDef hltdc,
uint32_t  XSize,
uint32_t  YSize,
uint32_t  LayerIdx 
)

Set the LTDC window size.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
XSizeLTDC Pixel per line
YSizeLTDC Line number
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1117 of file stm32l4xx_hal_ltdc.c.

1118 {
1119  LTDC_LayerCfgTypeDef *pLayerCfg;
1120 
1121  /* Check the parameters (Layers parameters)*/
1122  assert_param(IS_LTDC_LAYER(LayerIdx));
1123  assert_param(IS_LTDC_CFBLL(XSize));
1124  assert_param(IS_LTDC_CFBLNBR(YSize));
1125 
1126  /* Process locked */
1127  __HAL_LOCK(hltdc);
1128 
1129  /* Change LTDC peripheral state */
1130  hltdc->State = HAL_LTDC_STATE_BUSY;
1131 
1132  /* Get layer configuration from handle structure */
1133  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1134 
1135  /* update horizontal stop */
1136  pLayerCfg->WindowX1 = XSize + pLayerCfg->WindowX0;
1137 
1138  /* update vertical stop */
1139  pLayerCfg->WindowY1 = YSize + pLayerCfg->WindowY0;
1140 
1141  /* Reconfigures the color frame buffer pitch in byte */
1142  pLayerCfg->ImageWidth = XSize;
1143 
1144  /* Reconfigures the frame buffer line number */
1145  pLayerCfg->ImageHeight = YSize;
1146 
1147  /* Set LTDC parameters */
1148  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1149 
1150  /* Set the Immediate Reload type */
1151  hltdc->Instance->SRCR = LTDC_SRCR_IMR;
1152 
1153  /* Change the LTDC state*/
1154  hltdc->State = HAL_LTDC_STATE_READY;
1155 
1156  /* Process unlocked */
1157  __HAL_UNLOCK(hltdc);
1158 
1159  return HAL_OK;
1160 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_LTDC_SetWindowSize_NoReload()

HAL_StatusTypeDef HAL_LTDC_SetWindowSize_NoReload ( LTDC_HandleTypeDef hltdc,
uint32_t  XSize,
uint32_t  YSize,
uint32_t  LayerIdx 
)

Set the LTDC window size without reloading. Variant of the function HAL_LTDC_SetWindowSize without immediate reload.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
XSizeLTDC Pixel per line
YSizeLTDC Line number
LayerIdxLTDC Layer index. This parameter can be one of the following values: LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1)
Return values
HALstatus

Definition at line 1556 of file stm32l4xx_hal_ltdc.c.

1557 {
1558  LTDC_LayerCfgTypeDef *pLayerCfg;
1559 
1560  /* Check the parameters (Layers parameters)*/
1561  assert_param(IS_LTDC_LAYER(LayerIdx));
1562  assert_param(IS_LTDC_CFBLL(XSize));
1563  assert_param(IS_LTDC_CFBLNBR(YSize));
1564 
1565  /* Process locked */
1566  __HAL_LOCK(hltdc);
1567 
1568  /* Change LTDC peripheral state */
1569  hltdc->State = HAL_LTDC_STATE_BUSY;
1570 
1571  /* Get layer configuration from handle structure */
1572  pLayerCfg = &hltdc->LayerCfg[LayerIdx];
1573 
1574  /* update horizontal stop */
1575  pLayerCfg->WindowX1 = XSize + pLayerCfg->WindowX0;
1576 
1577  /* update vertical stop */
1578  pLayerCfg->WindowY1 = YSize + pLayerCfg->WindowY0;
1579 
1580  /* Reconfigures the color frame buffer pitch in byte */
1581  pLayerCfg->ImageWidth = XSize;
1582 
1583  /* Reconfigures the frame buffer line number */
1584  pLayerCfg->ImageHeight = YSize;
1585 
1586  /* Set LTDC parameters */
1587  LTDC_SetConfig(hltdc, pLayerCfg, LayerIdx);
1588 
1589  /* Change the LTDC state*/
1590  hltdc->State = HAL_LTDC_STATE_READY;
1591 
1592  /* Process unlocked */
1593  __HAL_UNLOCK(hltdc);
1594 
1595  return HAL_OK;
1596 }
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
static void LTDC_SetConfig(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx)
Configure the LTDC peripheral.
LTDC Layer structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))