STM32L4xx_HAL_Driver  1.14.0

GFXMMU operation functions. More...

Functions

HAL_StatusTypeDef HAL_GFXMMU_ConfigLut (GFXMMU_HandleTypeDef *hgfxmmu, uint32_t FirstLine, uint32_t LinesNumber, uint32_t Address)
 This function allows to copy LUT from flash to look up RAM. More...
 
HAL_StatusTypeDef HAL_GFXMMU_DisableLutLines (GFXMMU_HandleTypeDef *hgfxmmu, uint32_t FirstLine, uint32_t LinesNumber)
 This function allows to disable a range of LUT lines. More...
 
HAL_StatusTypeDef HAL_GFXMMU_ConfigLutLine (GFXMMU_HandleTypeDef *hgfxmmu, GFXMMU_LutLineTypeDef *lutLine)
 This function allows to configure one line of LUT. More...
 
HAL_StatusTypeDef HAL_GFXMMU_ModifyBuffers (GFXMMU_HandleTypeDef *hgfxmmu, GFXMMU_BuffersTypeDef *Buffers)
 This function allows to modify physical buffer addresses. More...
 
void HAL_GFXMMU_IRQHandler (GFXMMU_HandleTypeDef *hgfxmmu)
 This function handles the GFXMMU interrupts. More...
 
void HAL_GFXMMU_ErrorCallback (GFXMMU_HandleTypeDef *hgfxmmu)
 Error callback. More...
 

Detailed Description

GFXMMU operation functions.

  ==============================================================================
                      ##### Operation functions #####
  ==============================================================================
    [..]  This section provides functions allowing to:
      (+) Configure LUT.
      (+) Modify physical buffer adresses.
      (+) Manage error.

Function Documentation

◆ HAL_GFXMMU_ConfigLut()

HAL_StatusTypeDef HAL_GFXMMU_ConfigLut ( GFXMMU_HandleTypeDef hgfxmmu,
uint32_t  FirstLine,
uint32_t  LinesNumber,
uint32_t  Address 
)

This function allows to copy LUT from flash to look up RAM.

Parameters
hgfxmmuGFXMMU handle.
FirstLineFirst line enabled on LUT. This parameter must be a number between Min_Data = 0 and Max_Data = 1023.
LinesNumberNumber of lines enabled on LUT. This parameter must be a number between Min_Data = 1 and Max_Data = 1024.
AddressStart address of LUT in flash.
Return values
HALstatus.

Definition at line 476 of file stm32l4xx_hal_gfxmmu.c.

480 {
481  HAL_StatusTypeDef status = HAL_OK;
482 
483  /* Check parameters */
484  assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
485  assert_param(IS_GFXMMU_LUT_LINE(FirstLine));
486  assert_param(IS_GFXMMU_LUT_LINES_NUMBER(LinesNumber));
487 
488  /* Check GFXMMU state and coherent parameters */
489  if((hgfxmmu->State != HAL_GFXMMU_STATE_READY) || ((FirstLine + LinesNumber) > 1024U))
490  {
491  status = HAL_ERROR;
492  }
493  else
494  {
495  uint32_t current_address, current_line, lutxl_address, lutxh_address;
496 
497  /* Initialize local variables */
498  current_address = Address;
499  current_line = 0U;
500  lutxl_address = (uint32_t) &(hgfxmmu->Instance->LUT[2U * FirstLine]);
501  lutxh_address = (uint32_t) &(hgfxmmu->Instance->LUT[(2U * FirstLine) + 1U]);
502 
503  /* Copy LUT from flash to look up RAM */
504  while(current_line < LinesNumber)
505  {
506  *((uint32_t *)lutxl_address) = *((uint32_t *)current_address);
507  current_address += 4U;
508  *((uint32_t *)lutxh_address) = *((uint32_t *)current_address);
509  current_address += 4U;
510  lutxl_address += 8U;
511  lutxh_address += 8U;
512  current_line++;
513  }
514  }
515  /* Return function status */
516  return status;
517 }
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_GFXMMU_ConfigLutLine()

HAL_StatusTypeDef HAL_GFXMMU_ConfigLutLine ( GFXMMU_HandleTypeDef hgfxmmu,
GFXMMU_LutLineTypeDef lutLine 
)

This function allows to configure one line of LUT.

Parameters
hgfxmmuGFXMMU handle.
lutLineLUT line parameters.
Return values
HALstatus.

Definition at line 573 of file stm32l4xx_hal_gfxmmu.c.

574 {
575  HAL_StatusTypeDef status = HAL_OK;
576 
577  /* Check parameters */
578  assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
579  assert_param(IS_GFXMMU_LUT_LINE(lutLine->LineNumber));
580  assert_param(IS_GFXMMU_LUT_LINE_STATUS(lutLine->LineStatus));
581  assert_param(IS_GFXMMU_LUT_BLOCK(lutLine->FirstVisibleBlock));
582  assert_param(IS_GFXMMU_LUT_BLOCK(lutLine->LastVisibleBlock));
583  assert_param(IS_GFXMMU_LUT_LINE_OFFSET(lutLine->LineOffset));
584 
585  /* Check GFXMMU state */
586  if(hgfxmmu->State != HAL_GFXMMU_STATE_READY)
587  {
588  status = HAL_ERROR;
589  }
590  else
591  {
592  uint32_t lutxl_address, lutxh_address;
593 
594  /* Initialize local variables */
595  lutxl_address = (uint32_t) &(hgfxmmu->Instance->LUT[2U * lutLine->LineNumber]);
596  lutxh_address = (uint32_t) &(hgfxmmu->Instance->LUT[(2U * lutLine->LineNumber) + 1U]);
597 
598  /* Configure LUT line */
599  if(lutLine->LineStatus == GFXMMU_LUT_LINE_ENABLE)
600  {
601  /* Enable and configure LUT line */
602  *((uint32_t *)lutxl_address) = (lutLine->LineStatus |
603  (lutLine->FirstVisibleBlock << GFXMMU_LUTXL_FVB_OFFSET) |
604  (lutLine->LastVisibleBlock << GFXMMU_LUTXL_LVB_OFFSET));
605  *((uint32_t *)lutxh_address) = (uint32_t) lutLine->LineOffset;
606  }
607  else
608  {
609  /* Disable LUT line */
610  *((uint32_t *)lutxl_address) = 0U;
611  *((uint32_t *)lutxh_address) = 0U;
612  }
613  }
614  /* Return function status */
615  return status;
616 }
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_GFXMMU_DisableLutLines()

HAL_StatusTypeDef HAL_GFXMMU_DisableLutLines ( GFXMMU_HandleTypeDef hgfxmmu,
uint32_t  FirstLine,
uint32_t  LinesNumber 
)

This function allows to disable a range of LUT lines.

Parameters
hgfxmmuGFXMMU handle.
FirstLineFirst line to disable on LUT. This parameter must be a number between Min_Data = 0 and Max_Data = 1023.
LinesNumberNumber of lines to disable on LUT. This parameter must be a number between Min_Data = 1 and Max_Data = 1024.
Return values
HALstatus.

Definition at line 528 of file stm32l4xx_hal_gfxmmu.c.

531 {
532  HAL_StatusTypeDef status = HAL_OK;
533 
534  /* Check parameters */
535  assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
536  assert_param(IS_GFXMMU_LUT_LINE(FirstLine));
537  assert_param(IS_GFXMMU_LUT_LINES_NUMBER(LinesNumber));
538 
539  /* Check GFXMMU state and coherent parameters */
540  if((hgfxmmu->State != HAL_GFXMMU_STATE_READY) || ((FirstLine + LinesNumber) > 1024U))
541  {
542  status = HAL_ERROR;
543  }
544  else
545  {
546  uint32_t current_line, lutxl_address, lutxh_address;
547 
548  /* Initialize local variables */
549  current_line = 0U;
550  lutxl_address = (uint32_t) &(hgfxmmu->Instance->LUT[2U * FirstLine]);
551  lutxh_address = (uint32_t) &(hgfxmmu->Instance->LUT[(2U * FirstLine) + 1U]);
552 
553  /* Disable LUT lines */
554  while(current_line < LinesNumber)
555  {
556  *((uint32_t *)lutxl_address) = 0U;
557  *((uint32_t *)lutxh_address) = 0U;
558  lutxl_address += 8U;
559  lutxh_address += 8U;
560  current_line++;
561  }
562  }
563  /* Return function status */
564  return status;
565 }
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_GFXMMU_ErrorCallback()

__weak void HAL_GFXMMU_ErrorCallback ( GFXMMU_HandleTypeDef hgfxmmu)

Error callback.

Parameters
hgfxmmuGFXMMU handle.
Return values
None.

Definition at line 688 of file stm32l4xx_hal_gfxmmu.c.

689 {
690  /* Prevent unused argument(s) compilation warning */
691  UNUSED(hgfxmmu);
692 
693  /* NOTE : This function should not be modified, when the callback is needed,
694  the HAL_GFXMMU_ErrorCallback could be implemented in the user file.
695  */
696 }

◆ HAL_GFXMMU_IRQHandler()

void HAL_GFXMMU_IRQHandler ( GFXMMU_HandleTypeDef hgfxmmu)

This function handles the GFXMMU interrupts.

Parameters
hgfxmmuGFXMMU handle.
Return values
None.

Definition at line 657 of file stm32l4xx_hal_gfxmmu.c.

658 {
659  uint32_t flags, interrupts, error;
660 
661  /* Read current flags and interrupts and determine which error occurs */
662  flags = hgfxmmu->Instance->SR;
663  interrupts = (hgfxmmu->Instance->CR & GFXMMU_CR_ITS_MASK);
664  error = (flags & interrupts);
665 
666  if(error != 0U)
667  {
668  /* Clear flags on GFXMMU_FCR register */
669  hgfxmmu->Instance->FCR = error;
670 
671  /* Update GFXMMU error code */
672  hgfxmmu->ErrorCode |= error;
673 
674  /* Call GFXMMU error callback */
675 #if (USE_HAL_GFXMMU_REGISTER_CALLBACKS == 1)
676  hgfxmmu->ErrorCallback(hgfxmmu);
677 #else
678  HAL_GFXMMU_ErrorCallback(hgfxmmu);
679 #endif
680  }
681 }
void HAL_GFXMMU_ErrorCallback(GFXMMU_HandleTypeDef *hgfxmmu)
Error callback.

◆ HAL_GFXMMU_ModifyBuffers()

HAL_StatusTypeDef HAL_GFXMMU_ModifyBuffers ( GFXMMU_HandleTypeDef hgfxmmu,
GFXMMU_BuffersTypeDef Buffers 
)

This function allows to modify physical buffer addresses.

Parameters
hgfxmmuGFXMMU handle.
BuffersBuffers parameters.
Return values
HALstatus.

Definition at line 624 of file stm32l4xx_hal_gfxmmu.c.

625 {
626  HAL_StatusTypeDef status = HAL_OK;
627 
628  /* Check parameters */
629  assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
630  assert_param(IS_GFXMMU_BUFFER_ADDRESS(Buffers->Buf0Address));
631  assert_param(IS_GFXMMU_BUFFER_ADDRESS(Buffers->Buf1Address));
632  assert_param(IS_GFXMMU_BUFFER_ADDRESS(Buffers->Buf2Address));
633  assert_param(IS_GFXMMU_BUFFER_ADDRESS(Buffers->Buf3Address));
634 
635  /* Check GFXMMU state */
636  if(hgfxmmu->State != HAL_GFXMMU_STATE_READY)
637  {
638  status = HAL_ERROR;
639  }
640  else
641  {
642  /* Modify physical buffer adresses on GFXMMU_BxCR registers */
643  hgfxmmu->Instance->B0CR = Buffers->Buf0Address;
644  hgfxmmu->Instance->B1CR = Buffers->Buf1Address;
645  hgfxmmu->Instance->B2CR = Buffers->Buf2Address;
646  hgfxmmu->Instance->B3CR = Buffers->Buf3Address;
647  }
648  /* Return function status */
649  return status;
650 }
return HAL_OK
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))