STM32L4xx_HAL_Driver  1.14.0
Initialization and de-initialization functions

Initialization and de-initialization functions. More...

Functions

HAL_StatusTypeDef HAL_GFXMMU_Init (GFXMMU_HandleTypeDef *hgfxmmu)
 Initialize the GFXMMU according to the specified parameters in the GFXMMU_InitTypeDef structure and initialize the associated handle. More...
 
HAL_StatusTypeDef HAL_GFXMMU_DeInit (GFXMMU_HandleTypeDef *hgfxmmu)
 De-initialize the GFXMMU. More...
 
void HAL_GFXMMU_MspInit (GFXMMU_HandleTypeDef *hgfxmmu)
 Initialize the GFXMMU MSP. More...
 
void HAL_GFXMMU_MspDeInit (GFXMMU_HandleTypeDef *hgfxmmu)
 De-initialize the GFXMMU MSP. More...
 
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. More...
 
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. More...
 

Detailed Description

Initialization and de-initialization functions.

  ==============================================================================
          ##### Initialization and de-initialization functions #####
  ==============================================================================
    [..]  This section provides functions allowing to:
      (+) Initialize the GFXMMU.
      (+) De-initialize the GFXMMU.

Function Documentation

◆ HAL_GFXMMU_DeInit()

HAL_StatusTypeDef HAL_GFXMMU_DeInit ( GFXMMU_HandleTypeDef hgfxmmu)

De-initialize the GFXMMU.

Parameters
hgfxmmuGFXMMU handle.
Return values
HALstatus.

Definition at line 237 of file stm32l4xx_hal_gfxmmu.c.

238 {
239  HAL_StatusTypeDef status = HAL_OK;
240 
241  /* Check GFXMMU handle */
242  if(hgfxmmu == NULL)
243  {
244  status = HAL_ERROR;
245  }
246  else
247  {
248  /* Check parameters */
249  assert_param(IS_GFXMMU_ALL_INSTANCE(hgfxmmu->Instance));
250 
251  /* Disable all interrupts on GFXMMU_CR register */
252  hgfxmmu->Instance->CR &= ~(GFXMMU_CR_B0OIE | GFXMMU_CR_B1OIE | GFXMMU_CR_B2OIE | GFXMMU_CR_B3OIE |
253  GFXMMU_CR_AMEIE);
254 
255  /* Call GFXMMU MSP de-init function */
256 #if (USE_HAL_GFXMMU_REGISTER_CALLBACKS == 1)
257  if(hgfxmmu->MspDeInitCallback == NULL)
258  {
259  hgfxmmu->MspDeInitCallback = HAL_GFXMMU_MspDeInit;
260  }
261  hgfxmmu->MspDeInitCallback(hgfxmmu);
262 #else
263  HAL_GFXMMU_MspDeInit(hgfxmmu);
264 #endif
265 
266  /* Set GFXMMU to reset state */
267  hgfxmmu->State = HAL_GFXMMU_STATE_RESET;
268  }
269  /* Return function status */
270  return status;
271 }
return HAL_OK
void HAL_GFXMMU_MspDeInit(GFXMMU_HandleTypeDef *hgfxmmu)
De-initialize the GFXMMU MSP.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_GFXMMU_Init()

HAL_StatusTypeDef HAL_GFXMMU_Init ( GFXMMU_HandleTypeDef hgfxmmu)

Initialize the GFXMMU according to the specified parameters in the GFXMMU_InitTypeDef structure and initialize the associated handle.

Parameters
hgfxmmuGFXMMU handle.
Return values
HALstatus.

Definition at line 168 of file stm32l4xx_hal_gfxmmu.c.

169 {
170  HAL_StatusTypeDef status = HAL_OK;
171 
172  /* Check GFXMMU handle */
173  if(hgfxmmu == NULL)
174  {
175  status = HAL_ERROR;
176  }
177  else
178  {
179  /* Check parameters */
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));
187 
188 #if (USE_HAL_GFXMMU_REGISTER_CALLBACKS == 1)
189  /* Reset callback pointers to the weak predefined callbacks */
190  hgfxmmu->ErrorCallback = HAL_GFXMMU_ErrorCallback;
191 
192  /* Call GFXMMU MSP init function */
193  if(hgfxmmu->MspInitCallback == NULL)
194  {
195  hgfxmmu->MspInitCallback = HAL_GFXMMU_MspInit;
196  }
197  hgfxmmu->MspInitCallback(hgfxmmu);
198 #else
199  /* Call GFXMMU MSP init function */
200  HAL_GFXMMU_MspInit(hgfxmmu);
201 #endif
202 
203  /* Configure blocks per line and interrupts parameters on GFXMMU_CR register */
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)
208  {
209  assert_param(IS_GFXMMU_INTERRUPTS(hgfxmmu->Init.Interrupts.UsedInterrupts));
210  hgfxmmu->Instance->CR |= hgfxmmu->Init.Interrupts.UsedInterrupts;
211  }
212 
213  /* Configure default value on GFXMMU_DVR register */
214  hgfxmmu->Instance->DVR = hgfxmmu->Init.DefaultValue;
215 
216  /* Configure physical buffer adresses on GFXMMU_BxCR registers */
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;
221 
222  /* Reset GFXMMU error code */
223  hgfxmmu->ErrorCode = GFXMMU_ERROR_NONE;
224 
225  /* Set GFXMMU to ready state */
226  hgfxmmu->State = HAL_GFXMMU_STATE_READY;
227  }
228  /* Return function status */
229  return status;
230 }
void HAL_GFXMMU_MspInit(GFXMMU_HandleTypeDef *hgfxmmu)
Initialize the GFXMMU MSP.
return HAL_OK
void HAL_GFXMMU_ErrorCallback(GFXMMU_HandleTypeDef *hgfxmmu)
Error callback.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_GFXMMU_MspDeInit()

__weak void HAL_GFXMMU_MspDeInit ( GFXMMU_HandleTypeDef hgfxmmu)

De-initialize the GFXMMU MSP.

Parameters
hgfxmmuGFXMMU handle.
Return values
None.

Definition at line 293 of file stm32l4xx_hal_gfxmmu.c.

294 {
295  /* Prevent unused argument(s) compilation warning */
296  UNUSED(hgfxmmu);
297 
298  /* NOTE : This function should not be modified, when the function is needed,
299  the HAL_GFXMMU_MspDeInit could be implemented in the user file.
300  */
301 }

◆ HAL_GFXMMU_MspInit()

__weak void HAL_GFXMMU_MspInit ( GFXMMU_HandleTypeDef hgfxmmu)

Initialize the GFXMMU MSP.

Parameters
hgfxmmuGFXMMU handle.
Return values
None.

Definition at line 278 of file stm32l4xx_hal_gfxmmu.c.

279 {
280  /* Prevent unused argument(s) compilation warning */
281  UNUSED(hgfxmmu);
282 
283  /* NOTE : This function should not be modified, when the function is needed,
284  the HAL_GFXMMU_MspInit could be implemented in the user file.
285  */
286 }

◆ HAL_GFXMMU_RegisterCallback()

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.

Parameters
hgfxmmuGFXMMU handle.
CallbackIDID of the callback to be registered. This parameter can be one of the following values:
pCallbackpointer to the callback function.
Return values
HALstatus.

Definition at line 316 of file stm32l4xx_hal_gfxmmu.c.

319 {
320  HAL_StatusTypeDef status = HAL_OK;
321 
322  if(pCallback == NULL)
323  {
324  /* update the error code */
325  hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
326  /* update return status */
327  status = HAL_ERROR;
328  }
329  else
330  {
331  if(HAL_GFXMMU_STATE_READY == hgfxmmu->State)
332  {
333  switch (CallbackID)
334  {
336  hgfxmmu->ErrorCallback = pCallback;
337  break;
339  hgfxmmu->MspInitCallback = pCallback;
340  break;
342  hgfxmmu->MspDeInitCallback = pCallback;
343  break;
344  default :
345  /* update the error code */
346  hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
347  /* update return status */
348  status = HAL_ERROR;
349  break;
350  }
351  }
352  else if(HAL_GFXMMU_STATE_RESET == hgfxmmu->State)
353  {
354  switch (CallbackID)
355  {
357  hgfxmmu->MspInitCallback = pCallback;
358  break;
360  hgfxmmu->MspDeInitCallback = pCallback;
361  break;
362  default :
363  /* update the error code */
364  hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
365  /* update return status */
366  status = HAL_ERROR;
367  break;
368  }
369  }
370  else
371  {
372  /* update the error code */
373  hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
374  /* update return status */
375  status = HAL_ERROR;
376  }
377  }
378  return status;
379 }
return HAL_OK

◆ HAL_GFXMMU_UnRegisterCallback()

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.

Parameters
hgfxmmuGFXMMU handle.
CallbackIDID of the callback to be unregistered. This parameter can be one of the following values:
Return values
HALstatus.

Definition at line 392 of file stm32l4xx_hal_gfxmmu.c.

394 {
395  HAL_StatusTypeDef status = HAL_OK;
396 
397  if(HAL_GFXMMU_STATE_READY == hgfxmmu->State)
398  {
399  switch (CallbackID)
400  {
402  hgfxmmu->ErrorCallback = HAL_GFXMMU_ErrorCallback;
403  break;
405  hgfxmmu->MspInitCallback = HAL_GFXMMU_MspInit;
406  break;
408  hgfxmmu->MspDeInitCallback = HAL_GFXMMU_MspDeInit;
409  break;
410  default :
411  /* update the error code */
412  hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
413  /* update return status */
414  status = HAL_ERROR;
415  break;
416  }
417  }
418  else if(HAL_GFXMMU_STATE_RESET == hgfxmmu->State)
419  {
420  switch (CallbackID)
421  {
423  hgfxmmu->MspInitCallback = HAL_GFXMMU_MspInit;
424  break;
426  hgfxmmu->MspDeInitCallback = HAL_GFXMMU_MspDeInit;
427  break;
428  default :
429  /* update the error code */
430  hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
431  /* update return status */
432  status = HAL_ERROR;
433  break;
434  }
435  }
436  else
437  {
438  /* update the error code */
439  hgfxmmu->ErrorCode |= GFXMMU_ERROR_INVALID_CALLBACK;
440  /* update return status */
441  status = HAL_ERROR;
442  }
443  return status;
444 }
void HAL_GFXMMU_MspInit(GFXMMU_HandleTypeDef *hgfxmmu)
Initialize the GFXMMU MSP.
return HAL_OK
void HAL_GFXMMU_ErrorCallback(GFXMMU_HandleTypeDef *hgfxmmu)
Error callback.
void HAL_GFXMMU_MspDeInit(GFXMMU_HandleTypeDef *hgfxmmu)
De-initialize the GFXMMU MSP.