Macros
Defines
Peripheral Driver » HAL Driver » HAL DEFINE

## Macros
#define | HAL_NEVER_TIMEOUT (0xFFFFFFFFU)
| HAL never timeout definition. More...
#define | HAL_MAX_DELAY (20000U)
| HAL max delay definition. Unit is millisecond. 20000ms is the max delay time in 96MHz system clock. More...
#define | HAL_TIMEOUT_INIT()
| Timeout module init. This macro must be used in conjunction with the HAL_TIMEOUT_DEINIT macro. More...
#define | HAL_TIMEOUT_DEINIT()
| Timeout module deinit. This macro must be used in conjunction with the HAL_TIMEOUT_INIT macro. More...
#define | HAL_TIMEOUT_GET_TICK() (DWT->CYCCNT)
| Timeout module get current tick. More...
#define | HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET)
| Check whether the bits of register are set. More...
#define | HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET)
| Check whether the bits of register are clear. More...
#define | __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_)
| Link DMA handle and peripheral handle. More...
#define | __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = 0U)
| Reset the Handle's State field. More...
#define | __HAL_LOCK(__HANDLE__)
| Lock peripheral handle. More...
#define | __HAL_UNLOCK(__HANDLE__)
| Unlock peripheral handle. More...
#define | __ALIGN_END

## Detailed Description

## Macro Definition Documentation

## ◆ __ALIGN_END

#define __ALIGN_END

ALIGN END

Definition at line 227 of file gr55xx_hal_def.h.

## ◆ __HAL_LINKDMA

#define __HAL_LINKDMA | ( |  | __HANDLE__,
|  |  | __PPP_DMA_FIELD_,
|  |  | __DMA_HANDLE_
| ) |  |

Value:
do{ \
(__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_); \
(__DMA_HANDLE_).p_parent = (__HANDLE__); \
} while(0U)

Link DMA handle and peripheral handle.

Parameters

  __HANDLE__ | specifies the peripheral handle.
  __PPP_DMA_FIELD_ | specifies the DMA pointer in struction of peripheral handle.
  __DMA_HANDLE_ | specifies the DMA handle.

Return values

  None |

Definition at line 152 of file gr55xx_hal_def.h.

## ◆ __HAL_LOCK

#define __HAL_LOCK | ( |  | __HANDLE__ | ) |

Value:
do{ \
if((__HANDLE__)->lock == HAL_LOCKED) \
{ \
return HAL_BUSY; \
} \
else \
{ \
(__HANDLE__)->lock = HAL_LOCKED; \
} \
}while (0U)

Lock peripheral handle.

Parameters

  __HANDLE__ | specifies the peripheral handle.

Return values

  HAL_BUSY | If handle is locked.

Definition at line 183 of file gr55xx_hal_def.h.

## ◆ __HAL_RESET_HANDLE_STATE

#define __HAL_RESET_HANDLE_STATE | ( |  | __HANDLE__ | ) | ((__HANDLE__)->state = 0U)

Reset the Handle's State field.

Parameters

  __HANDLE__ | specifies the Peripheral Handle.

Note
  This macro can be used for the following purposes:
  - When the Handle is declared as local variable; before passing it as parameter to hal_ppp_init() for the first time, it is mandatory to use this macro to set the Handle's "State" field to 0. Otherwise, "State" field may have any random value and the first time the function hal_ppp_init() is called, the low level hardware initialization will be missed (i.e. hal_ppp_msp_init() will not be executed).
  - When there is a need to reconfigure the low level hardware: instead of calling hal_ppp_deinit() then hal_ppp_init(), user can make a call to this macro then hal_ppp_init(). In this later function, when the Handle's "State" field is set to 0, it will execute the function hal_ppp_msp_init which will reconfigure the low level hardware.

Return values

  None |

Definition at line 173 of file gr55xx_hal_def.h.

## ◆ __HAL_UNLOCK

#define __HAL_UNLOCK | ( |  | __HANDLE__ | ) |

Value:
do{ \
(__HANDLE__)->lock = HAL_UNLOCKED; \
}while (0U)

Unlock peripheral handle.

Parameters

  __HANDLE__ | specifies the peripheral handle.

Return values

  None |

Definition at line 200 of file gr55xx_hal_def.h.

## ◆ HAL_IS_BIT_CLR

#define HAL_IS_BIT_CLR | ( |  | REG,
|  |  | BIT
| ) |  | (((REG) & (BIT)) == RESET)

Check whether the bits of register are clear.

Parameters

  REG | specifies the register.
  BIT | specifies the bits will be checked.

Return values

  SET | (BIT is clear) or RESET (BIT is not clear)

Definition at line 143 of file gr55xx_hal_def.h.

## ◆ HAL_IS_BIT_SET

#define HAL_IS_BIT_SET | ( |  | REG,
|  |  | BIT
| ) |  | (((REG) & (BIT)) != RESET)

Check whether the bits of register are set.

Parameters

  REG | specifies the register.
  BIT | specifies the bits will be checked.

Return values

  SET | (BIT is set) or RESET (BIT is not set)

Definition at line 136 of file gr55xx_hal_def.h.

## ◆ HAL_MAX_DELAY

#define HAL_MAX_DELAY (20000U)

HAL max delay definition. Unit is millisecond. 20000ms is the max delay time in 96MHz system clock.

Definition at line 102 of file gr55xx_hal_def.h.

## ◆ HAL_NEVER_TIMEOUT

#define HAL_NEVER_TIMEOUT (0xFFFFFFFFU)

HAL never timeout definition.

Definition at line 96 of file gr55xx_hal_def.h.

## ◆ HAL_TIMEOUT_DEINIT

#define HAL_TIMEOUT_DEINIT | ( |  | ) |

Value:
do { \
hal_dwt_disable(_demcr_initial, _dwt_ctrl_initial); \
} while(0)

Timeout module deinit. This macro must be used in conjunction with the HAL_TIMEOUT_INIT macro.

Definition at line 119 of file gr55xx_hal_def.h.

## ◆ HAL_TIMEOUT_GET_TICK

#define HAL_TIMEOUT_GET_TICK | ( |  | ) | (DWT->CYCCNT)

Timeout module get current tick.

Return values

  Current | tick

Definition at line 128 of file gr55xx_hal_def.h.

## ◆ HAL_TIMEOUT_INIT

#define HAL_TIMEOUT_INIT | ( |  | ) |

Value:
uint32_t _demcr_initial = CoreDebug->DEMCR; \
uint32_t _dwt_ctrl_initial = DWT->CTRL; \
do { \
hal_dwt_enable(_demcr_initial, _dwt_ctrl_initial); \
} while (0)

Timeout module init. This macro must be used in conjunction with the HAL_TIMEOUT_DEINIT macro.

Definition at line 108 of file gr55xx_hal_def.h.

HAL_BUSY
@ HAL_BUSY
Definition: gr55xx_hal_def.h:73
HAL_UNLOCKED
@ HAL_UNLOCKED
Definition: gr55xx_hal_def.h:82
HAL_LOCKED
@ HAL_LOCKED
Definition: gr55xx_hal_def.h:83