HAL GFXMMU Functions

Initialization and de-initialization functions

group GFXMMU_Exported_Functions_Group1

This subsection provides a set of functions allowing to initialize and de-initialize the GFXMMU peripheral:

  • HAL_GFXMMU_Init() to initialize the selected HAL GFXMMU handle and associate a GFXMMU peripheral instance.

  • HAL_GFXMMU_DeInit() to de-initialize the given HAL GFXMMU instance and reset the state machine.

Functions

hal_status_t HAL_GFXMMU_Init ( hal_gfxmmu_handle_t * hgfxmmu , hal_gfxmmu_t instance )

Initialize the GFXMMU handle and associates an instance.

Parameters :
Return values :
  • HAL_OK – GFXMMU handle has been correctly initialized.

  • HAL_INVALID_PARAM – invalid parameter.

void HAL_GFXMMU_DeInit ( hal_gfxmmu_handle_t * hgfxmmu )

DeInitialize the GFXMMU peripheral.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Operations functions

group GFXMMU_Exported_Functions_Group2

This subsection provides a set of APIs allowing to configure the GFXMMU peripheral:

Note

- (*) For more information about this feature please refer to the subsection Cache maintenance operation in the reference manual.

Functions

hal_status_t HAL_GFXMMU_SetConfig ( hal_gfxmmu_handle_t * hgfxmmu , const hal_gfxmmu_config_t * p_config )

Configure the GFXMMU configuration with the specified parameters in the hal_gfxmmu_config_t .

Parameters :
Return values :
  • HAL_OK – configuration succeeded.

  • HAL_INVALID_PARAM – invalid parameter.

void HAL_GFXMMU_GetConfig ( const hal_gfxmmu_handle_t * hgfxmmu , hal_gfxmmu_config_t * p_config )

Get the GFXMMU configuration and fill parameters in the hal_gfxmmu_config_t .

Parameters :
hal_status_t HAL_GFXMMU_SetLUT ( hal_gfxmmu_handle_t * hgfxmmu , const hal_gfxmmu_lut_config_t * p_config )

Configure the LUT with the specified parameters in the hal_gfxmmu_lut_config_t .

Parameters :
Return values :
  • HAL_OK – configuration succeeded.

  • HAL_INVALID_PARAM – invalid parameter.

hal_status_t HAL_GFXMMU_SetBuffPhysicalAddr ( hal_gfxmmu_handle_t * hgfxmmu , hal_gfxmmu_buff_t buff , uint32_t buff_physical_addr )

Set the physical buffer address.

Parameters :
Return values :

HAL_OK.

uint32_t HAL_GFXMMU_GetBuffPhysicalAddr ( const hal_gfxmmu_handle_t * hgfxmmu , hal_gfxmmu_buff_t buff )

Get the buffer physical address.

Parameters :
Return values :

buffer – physical address.

hal_status_t HAL_GFXMMU_SetDefaultReturnVal ( hal_gfxmmu_handle_t * hgfxmmu , uint32_t val )

Set the default return value.

Parameters :
  • hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

  • val – value returned when virtual memory location not physically mapped.

Return values :

HAL_OK.

uint32_t HAL_GFXMMU_GetDefaultReturnVal ( const hal_gfxmmu_handle_t * hgfxmmu )

Get the default return value.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :

uint32_t – default return value.

hal_status_t HAL_GFXMMU_ResetLutLines ( hal_gfxmmu_handle_t * hgfxmmu , uint32_t start_line , uint32_t lines_nbr )

Disable a range of LUT lines.

Parameters :
  • hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

  • start_line – first line to disable on LUT.

  • lines_nbr – number of lines to disable on LUT.

Return values :

HAL_OK.

hal_status_t HAL_GFXMMU_EnableCache ( hal_gfxmmu_handle_t * hgfxmmu )

Enable cache or address cache.

Note

the selected cache or address cache is based on the used devices. For more information please refer to the section “GFXMMU implementation” in the reference manual.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :

HAL_OK.

hal_status_t HAL_GFXMMU_DisableCache ( hal_gfxmmu_handle_t * hgfxmmu )

Disable cache or address cache.

Note

the selected cache or address cache is based on the used devices. For more information please refer to the section “GFXMMU implementation” in the reference manual.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :

HAL_OK.

hal_gfxmmu_cache_status_t HAL_GFXMMU_IsEnabledCache ( const hal_gfxmmu_handle_t * hgfxmmu )

Check the cache or the address cache status.

Note

the selected cache or address cache is based on the used devices. For more information please refer to the section “GFXMMU implementation” in the reference manual.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :
  • HAL_GFXMMU_CACHE_ENABLED – cache is enabled.

  • HAL_GFXMMU_CACHE_DISABLED – cache is disabled.

hal_status_t HAL_GFXMMU_EnableCacheLockBuff ( hal_gfxmmu_handle_t * hgfxmmu , hal_gfxmmu_buff_t buff )

Lock the cache or the address cache to a buffer.

Note

the selected cache or address cache is based on the used devices. For more information please refer to the section “GFXMMU implementation” in the reference manual.

Parameters :
Return values :
  • HAL_OK – cache lock has been correctly configured.

  • HAL_ERROR – configuration fail.

hal_status_t HAL_GFXMMU_DisableCacheLockBuff ( hal_gfxmmu_handle_t * hgfxmmu )

Unlock the cache or the address cache from a buffer.

Note

the selected cache or address cache is based on the used devices. For more information please refer to the section “GFXMMU implementation” in the reference manual.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :

HAL_OK.

hal_gfxmmu_cache_lock_status_t HAL_GFXMMU_IsEnabledCacheLockBuff ( const hal_gfxmmu_handle_t * hgfxmmu )

Check whether the cache or the address cache is locked or not.

Note

the selected cache or address cache is based on the used devices. For more information please refer to the section “GFXMMU implementation” in the reference manual.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :
  • HAL_GFXMMU_CACHE_LOCK_ENABLED – cache is enabled.

  • HAL_GFXMMU_CACHE_LOCK_DISABLED – cache is disabled.

IRQHandler and callback function

group GFXMMU_Exported_Functions_Group3

This subsection provides a set the GFXMMU callbacks registration APIs:

Functions

void HAL_GFXMMU_IRQHandler ( hal_gfxmmu_handle_t * hgfxmmu )

Handles GFXMMU interrupt request.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

void HAL_GFXMMU_ErrorCallback ( hal_gfxmmu_handle_t * hgfxmmu )

GFXMMU error callback.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

hal_status_t HAL_GFXMMU_RegisterErrorCallback ( hal_gfxmmu_handle_t * hgfxmmu , hal_gfxmmu_cb_t callback )

Register a User GFXMMU callback.

Parameters :
Return values :
  • HAL_OK – succeed.

  • HAL_INVALID_PARAM – invalid callback.

State functions

group GFXMMU_Exported_Functions_Group4

This subsection provides a set of functions to retrieve the state and the error codes

Functions

hal_gfxmmu_state_t HAL_GFXMMU_GetState ( const hal_gfxmmu_handle_t * hgfxmmu )

Get the current GFXMMU handle state.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :

hal_gfxmmu_state_t – GFXMMU global state.

hal_gfxmmu_buff_state_t HAL_GFXMMU_GetBuffState ( const hal_gfxmmu_handle_t * hgfxmmu , hal_gfxmmu_buff_t buff )

Get the current buffer state.

Parameters :
Return values :

hal_gfxmmu_buff_state_t – GFXMMU buffer state.

hal_gfxmmu_lut_state_t HAL_GFXMMU_GetLUTState ( const hal_gfxmmu_handle_t * hgfxmmu )

Get the current lut state.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :

hal_gfxmmu_lut_state_t – GFXMMU lut state.

uint32_t HAL_GFXMMU_GetLastErrorCodes ( const hal_gfxmmu_handle_t * hgfxmmu )

Return the GFXMMU handle error code.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :

uint32_t – GFXMMU last error codes which can be one of the following value GFXMMU Error Code

User Data functions

group GFXMMU_Exported_Functions_Group5

This subsection provides a set of functions allowing to Set and Get user data:

Functions

void HAL_GFXMMU_SetUserData ( hal_gfxmmu_handle_t * hgfxmmu , const void * p_user_data )

Store the user data into the GFXMMU handle.

Parameters :
const void * HAL_GFXMMU_GetUserData ( const hal_gfxmmu_handle_t * hgfxmmu )

Get the user data from the GFXMMU handle.

Parameters :

hgfxmmu – pointer to hal_gfxmmu_handle_t structure.

Return values :

Pointer – to the user data

Interrupt functions

group GFXMMU_Exported_Functions_Group6

This subsection provides a set of APIs allowing to manage the GFXMMU interrupts and flags:

Functions

void HAL_GFXMMU_EnableIT ( hal_gfxmmu_handle_t * hgfxmmu , uint32_t it_source )

Enable the specified GFXMMU interrupt.

Parameters :
  • hgfxmmu – specifies the GFXMMU handle

  • it_source – specifies the GFXMMU interrupt source to enable This parameter can be a combination of the following values:

    • HAL_GFXMMU_IT_AHB_MASTER_ERROR: AHB master error interrupt

    • HAL_GFXMMU_IT_BUFFER0_OVERFLOW: Buffer 0 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER1_OVERFLOW: Buffer 1 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER2_OVERFLOW: Buffer 2 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER3_OVERFLOW: Buffer 3 overflow interrupt

void HAL_GFXMMU_DisableIT ( hal_gfxmmu_handle_t * hgfxmmu , uint32_t it_source )

Disable the specified GFXMMU interrupt.

Parameters :
  • hgfxmmu – specifies the GFXMMU handle

  • it_source – specifies the GFXMMU interrupt source to disable This parameter can be a combination of the following values:

    • HAL_GFXMMU_IT_AHB_MASTER_ERROR: AHB master error interrupt

    • HAL_GFXMMU_IT_BUFFER0_OVERFLOW: Buffer 0 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER1_OVERFLOW: Buffer 1 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER2_OVERFLOW: Buffer 2 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER3_OVERFLOW: Buffer 3 overflow interrupt

uint32_t HAL_GFXMMU_IsEnabledIT ( const hal_gfxmmu_handle_t * hgfxmmu , uint32_t it_source )

Check whether the specified GFXMMU interrupt source is enabled or not.

Parameters :
  • hgfxmmu – specifies the GFXMMU handle

  • it_source – specifies the GFXMMU interrupt source to check This parameter must be one of the following values:

    • HAL_GFXMMU_IT_AHB_MASTER_ERROR: AHB master error interrupt

    • HAL_GFXMMU_IT_BUFFER0_OVERFLOW: Buffer 0 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER1_OVERFLOW: Buffer 1 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER2_OVERFLOW: Buffer 2 overflow interrupt

    • HAL_GFXMMU_IT_BUFFER3_OVERFLOW: Buffer 3 overflow interrupt

Return values :

The – new state of it_source (SET or RESET)

uint32_t HAL_GFXMMU_IsActiveFlag ( const hal_gfxmmu_handle_t * hgfxmmu , uint32_t flag )

Check whether the specified GFXMMU flag is set or not.

Parameters :
  • hgfxmmu – specifies the GFXMMU handle

  • flag – Specifies the flag source to check This parameter must be one of the following values:

    • HAL_GFXMMU_FLAG_AHB_MASTER_ERROR: AHB master error flag

    • HAL_GFXMMU_FLAG_BUFFER0_OVERFLOW: Buffer 0 overflow flag

    • HAL_GFXMMU_FLAG_BUFFER1_OVERFLOW: Buffer 1 overflow flag

    • HAL_GFXMMU_FLAG_BUFFER2_OVERFLOW: Buffer 2 overflow flag

    • HAL_GFXMMU_FLAG_BUFFER3_OVERFLOW: Buffer 3 overflow flag

Return values :

The – new state of GFXMMU_FLAG (SET or RESET)

void HAL_GFXMMU_ClearFlag ( hal_gfxmmu_handle_t * hgfxmmu , uint32_t flag )

Clear the GFXMMU pending flags.

Parameters :
  • hgfxmmu – specifies the GFXMMU handle

  • flag – Specifies the flag source to check This parameter can be a combination of the following values:

    • HAL_GFXMMU_FLAG_AHB_MASTER_ERROR: AHB master error flag

    • HAL_GFXMMU_FLAG_BUFFER0_OVERFLOW: Buffer 0 overflow flag

    • HAL_GFXMMU_FLAG_BUFFER1_OVERFLOW: Buffer 1 overflow flag

    • HAL_GFXMMU_FLAG_BUFFER2_OVERFLOW: Buffer 2 overflow flag

    • HAL_GFXMMU_FLAG_BUFFER3_OVERFLOW: Buffer 3 overflow flag