128 #ifdef HAL_GFXMMU_MODULE_ENABLED 137 #define GFXMMU_LUTXL_FVB_OFFSET 8U 138 #define GFXMMU_LUTXL_LVB_OFFSET 16U 139 #define GFXMMU_CR_ITS_MASK 0x1FU 170 HAL_StatusTypeDef status =
HAL_OK;
180 assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
181 assert_param(IS_GFXMMU_BLOCKS_PER_LINE(hgfxmmu->Init.BlocksPerLine));
182 assert_param(IS_GFXMMU_BUFFER_ADDRESS(hgfxmmu->Init.Buffers.Buf0Address));
183 assert_param(IS_GFXMMU_BUFFER_ADDRESS(hgfxmmu->Init.Buffers.Buf1Address));
184 assert_param(IS_GFXMMU_BUFFER_ADDRESS(hgfxmmu->Init.Buffers.Buf2Address));
185 assert_param(IS_GFXMMU_BUFFER_ADDRESS(hgfxmmu->Init.Buffers.Buf3Address));
186 assert_param(IS_FUNCTIONAL_STATE(hgfxmmu->Init.Interrupts.Activation));
188 #if (USE_HAL_GFXMMU_REGISTER_CALLBACKS == 1) 193 if(hgfxmmu->MspInitCallback == NULL)
197 hgfxmmu->MspInitCallback(hgfxmmu);
204 hgfxmmu->Instance->CR &= ~(GFXMMU_CR_B0OIE | GFXMMU_CR_B1OIE | GFXMMU_CR_B2OIE | GFXMMU_CR_B3OIE |
205 GFXMMU_CR_AMEIE | GFXMMU_CR_192BM);
206 hgfxmmu->Instance->CR |= (hgfxmmu->Init.BlocksPerLine);
207 if(hgfxmmu->Init.Interrupts.Activation == ENABLE)
209 assert_param(IS_GFXMMU_INTERRUPTS(hgfxmmu->Init.Interrupts.UsedInterrupts));
210 hgfxmmu->Instance->CR |= hgfxmmu->Init.Interrupts.UsedInterrupts;
214 hgfxmmu->Instance->DVR = hgfxmmu->Init.DefaultValue;
217 hgfxmmu->Instance->B0CR = hgfxmmu->Init.Buffers.Buf0Address;
218 hgfxmmu->Instance->B1CR = hgfxmmu->Init.Buffers.Buf1Address;
219 hgfxmmu->Instance->B2CR = hgfxmmu->Init.Buffers.Buf2Address;
220 hgfxmmu->Instance->B3CR = hgfxmmu->Init.Buffers.Buf3Address;
223 hgfxmmu->ErrorCode = GFXMMU_ERROR_NONE;
226 hgfxmmu->State = HAL_GFXMMU_STATE_READY;
239 HAL_StatusTypeDef status =
HAL_OK;
249 assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
252 hgfxmmu->Instance->CR &= ~(GFXMMU_CR_B0OIE | GFXMMU_CR_B1OIE | GFXMMU_CR_B2OIE | GFXMMU_CR_B3OIE |
256 #if (USE_HAL_GFXMMU_REGISTER_CALLBACKS == 1) 257 if(hgfxmmu->MspDeInitCallback == NULL)
261 hgfxmmu->MspDeInitCallback(hgfxmmu);
267 hgfxmmu->State = HAL_GFXMMU_STATE_RESET;
303 #if (USE_HAL_GFXMMU_REGISTER_CALLBACKS == 1) 320 HAL_StatusTypeDef status =
HAL_OK;
322 if(pCallback == NULL)
325 hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
331 if(HAL_GFXMMU_STATE_READY == hgfxmmu->State)
336 hgfxmmu->ErrorCallback = pCallback;
339 hgfxmmu->MspInitCallback = pCallback;
342 hgfxmmu->MspDeInitCallback = pCallback;
346 hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
352 else if(HAL_GFXMMU_STATE_RESET == hgfxmmu->State)
357 hgfxmmu->MspInitCallback = pCallback;
360 hgfxmmu->MspDeInitCallback = pCallback;
364 hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
373 hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
395 HAL_StatusTypeDef status =
HAL_OK;
397 if(HAL_GFXMMU_STATE_READY == hgfxmmu->State)
412 hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
418 else if(HAL_GFXMMU_STATE_RESET == hgfxmmu->State)
430 hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
439 hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
478 uint32_t LinesNumber,
481 HAL_StatusTypeDef status =
HAL_OK;
484 assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
489 if((hgfxmmu->State != HAL_GFXMMU_STATE_READY) || ((FirstLine + LinesNumber) > 1024U))
495 uint32_t current_address, current_line, lutxl_address, lutxh_address;
498 current_address = Address;
500 lutxl_address = (uint32_t) &(hgfxmmu->Instance->LUT[2U * FirstLine]);
501 lutxh_address = (uint32_t) &(hgfxmmu->Instance->LUT[(2U * FirstLine) + 1U]);
504 while(current_line < LinesNumber)
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;
530 uint32_t LinesNumber)
532 HAL_StatusTypeDef status =
HAL_OK;
535 assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
540 if((hgfxmmu->State != HAL_GFXMMU_STATE_READY) || ((FirstLine + LinesNumber) > 1024U))
546 uint32_t current_line, lutxl_address, lutxh_address;
550 lutxl_address = (uint32_t) &(hgfxmmu->Instance->LUT[2U * FirstLine]);
551 lutxh_address = (uint32_t) &(hgfxmmu->Instance->LUT[(2U * FirstLine) + 1U]);
554 while(current_line < LinesNumber)
556 *((uint32_t *)lutxl_address) = 0U;
557 *((uint32_t *)lutxh_address) = 0U;
575 HAL_StatusTypeDef status =
HAL_OK;
578 assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
586 if(hgfxmmu->State != HAL_GFXMMU_STATE_READY)
592 uint32_t lutxl_address, lutxh_address;
595 lutxl_address = (uint32_t) &(hgfxmmu->Instance->LUT[2U * lutLine->
LineNumber]);
596 lutxh_address = (uint32_t) &(hgfxmmu->Instance->LUT[(2U * lutLine->
LineNumber) + 1U]);
599 if(lutLine->
LineStatus == GFXMMU_LUT_LINE_ENABLE)
602 *((uint32_t *)lutxl_address) = (lutLine->
LineStatus |
605 *((uint32_t *)lutxh_address) = (uint32_t) lutLine->
LineOffset;
610 *((uint32_t *)lutxl_address) = 0U;
611 *((uint32_t *)lutxh_address) = 0U;
626 HAL_StatusTypeDef status =
HAL_OK;
629 assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
636 if(hgfxmmu->State != HAL_GFXMMU_STATE_READY)
659 uint32_t flags, interrupts, error;
662 flags = hgfxmmu->Instance->SR;
663 interrupts = (hgfxmmu->Instance->CR & GFXMMU_CR_ITS_MASK);
664 error = (flags & interrupts);
669 hgfxmmu->Instance->FCR = error;
672 hgfxmmu->ErrorCode |= error;
675 #if (USE_HAL_GFXMMU_REGISTER_CALLBACKS == 1) 676 hgfxmmu->ErrorCallback(hgfxmmu);
724 return hgfxmmu->State;
740 error_code = hgfxmmu->ErrorCode;
741 hgfxmmu->ErrorCode = GFXMMU_ERROR_NONE;
HAL_StatusTypeDef HAL_GFXMMU_ConfigLutLine(GFXMMU_HandleTypeDef *hgfxmmu, GFXMMU_LutLineTypeDef *lutLine)
This function allows to configure one line of LUT.
void HAL_GFXMMU_MspInit(GFXMMU_HandleTypeDef *hgfxmmu)
Initialize the GFXMMU MSP.
uint32_t FirstVisibleBlock
GFXMMU LUT line structure definition.
This file contains all the functions prototypes for the HAL module driver.
void(* pGFXMMU_CallbackTypeDef)(GFXMMU_HandleTypeDef *hgfxmmu)
GFXMMU callback pointer definition.
void HAL_GFXMMU_IRQHandler(GFXMMU_HandleTypeDef *hgfxmmu)
This function handles the GFXMMU interrupts.
HAL_StatusTypeDef HAL_GFXMMU_ModifyBuffers(GFXMMU_HandleTypeDef *hgfxmmu, GFXMMU_BuffersTypeDef *Buffers)
This function allows to modify physical buffer addresses.
HAL_StatusTypeDef HAL_GFXMMU_DisableLutLines(GFXMMU_HandleTypeDef *hgfxmmu, uint32_t FirstLine, uint32_t LinesNumber)
This function allows to disable a range of LUT lines.
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.
HAL_StatusTypeDef HAL_GFXMMU_UnRegisterCallback(GFXMMU_HandleTypeDef *hgfxmmu, HAL_GFXMMU_CallbackIDTypeDef CallbackID)
Unregister a user GFXMMU callback. GFXMMU callback is redirected to the weak predefined callback...
HAL_GFXMMU_StateTypeDef HAL_GFXMMU_GetState(GFXMMU_HandleTypeDef *hgfxmmu)
This function allows to get the current GFXMMU handle state.
uint32_t HAL_GFXMMU_GetError(GFXMMU_HandleTypeDef *hgfxmmu)
This function allows to get the current GFXMMU error code.
HAL_StatusTypeDef HAL_GFXMMU_RegisterCallback(GFXMMU_HandleTypeDef *hgfxmmu, HAL_GFXMMU_CallbackIDTypeDef CallbackID, pGFXMMU_CallbackTypeDef pCallback)
Register a user GFXMMU callback to be used instead of the weak predefined callback.
HAL_StatusTypeDef HAL_GFXMMU_DeInit(GFXMMU_HandleTypeDef *hgfxmmu)
De-initialize the GFXMMU.
HAL_GFXMMU_CallbackIDTypeDef
GFXMMU callback ID enumeration definition.
HAL_StatusTypeDef HAL_GFXMMU_Init(GFXMMU_HandleTypeDef *hgfxmmu)
Initialize the GFXMMU according to the specified parameters in the GFXMMU_InitTypeDef structure and i...
void HAL_GFXMMU_ErrorCallback(GFXMMU_HandleTypeDef *hgfxmmu)
Error callback.
uint32_t LastVisibleBlock
struct __GFXMMU_HandleTypeDef else typedef struct endif GFXMMU_HandleTypeDef
GFXMMU handle structure definition.
void HAL_GFXMMU_MspDeInit(GFXMMU_HandleTypeDef *hgfxmmu)
De-initialize the GFXMMU MSP.
GFXMMU buffers structure definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))