bf0_hal.h
Defines
-
MAKE_REG_VAL(val, mask, offset)
-
GET_REG_VAL(reg, mask, offset)
-
SYSCFG_BOOT_NORMAL
Normal boot
-
SYSCFG_BOOT_UART
Boot with UART loop for DFU
-
SYSCFG_SWD_HCPU
SWD interface connect to HCPU
-
SYSCFG_SWD_LCPU
SWD interface connect to LCPU
-
SYSCFG_SWD_BCPU
SWD interface connect to BCPU
-
__HAL_SYSCFG_GET_BOOT_MODE()
Get Current boot mode.
- Return values:
The – boot mode as configured by user
-
__HAL_SYSCFG_SET_SWD(COREID)
Set SWD interface.
- Parameters:
COREID – core id for SWD
-
__HAL_SYSCFG_SET_SECURITY()
Set Security Key control.
-
__HAL_SYSCFG_CLEAR_SECURITY()
Clear Security Key control.
-
__HAL_SYSCFG_GET_SID()
Get serial ID
-
__HAL_SYSCFG_GET_CID()
Get Chip ID
-
__HAL_SYSCFG_GET_PID()
Get Package ID
-
__HAL_SYSCFG_GET_REVID()
Get Revision ID
-
__HAL_SYSCFG_CHECK_REVID()
-
__HAL_SYSCFG_Enable_USB()
Enable USB module
-
__HAL_SYSCFG_USB_DM_PD()
Pull Down USB DM pin, host only
-
__HAL_SYSCFG_Enable_WDT_REBOOT(enable)
-
__HAL_SYSCFG_Enable_Assert_Trigger(enable)
-
__HAL_SYSCFG_Trigger_Assert()
-
__HAL_SYSCFG_Get_Trigger_Assert_Flag()
-
__HAL_SYSCFG_HPBG_EN()
-
__HAL_SYSCFG_HPBG_VDDPSW_EN()
-
SystemFixClock
-
__HAL_ROM_USED
-
HAL_ALIGN(size, align)
-
HAL_ALIGN_DOWN(size, align)
-
HAL_MIN(a, b)
-
HAL_MAX(a, b)
-
HAL_ABS(x)
-
HAL_CHIP_REV_ID_A3
CHIP ID for A3.
-
HAL_CHIP_REV_ID_A4
-
HAL_CHIP_REV_ID_B4
-
HAL_LXT_ENABLED()
-
HAL_LXT_DISABLED()
-
HAL_ASSERT(expr)
Functions
-
HAL_StatusTypeDef HAL_Init(void)
Configure the Flash prefetch, the Instruction and Data caches, the time base source, NVIC and any required global low level hardware by calling the HAL_PreInit() callback function to be optionally defined in user file.
Note
HAL_Init() function is called at the beginning of program after reset and before the clock configuration.
Note
In the default implementation the System Timer (Systick) is used as source of time base. The Systick configuration is based on MSI clock, as MSI is the clock used after a system Reset and the NVIC configuration is set to Priority group 4. Once done, time base tick starts incrementing: the tick variable counter is incremented each 1ms in the SysTick_Handler() interrupt handler.
- Return values:
HAL – status
-
void HAL_PreInit(void)
Before HAL_Init is called, board specific initialization.
- Return values:
None –
-
void HAL_PostMspInit(void)
It’s called after HAL_PreInit in HAL_Init.
- Return values:
None –
-
HAL_StatusTypeDef HAL_DeInit(void)
De-initialize common part of the HAL and stop the source of time base.
Note
This function is optional.
- Return values:
HAL – status
-
void HAL_MspDeInit(void)
DeInitialize the MSP.
- Return values:
None –
-
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
This function configures the source of the time base: The time source is configured to have 1ms time base with a dedicated Tick interrupt priority.
Note
This function is called automatically at the beginning of program after reset by HAL_Init() or at any time when clock is reconfigured by HAL_RCC_ClockConfig().
Note
In the default implementation, SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Care must be taken if HAL_Delay() is called from a peripheral ISR process, The SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked. The function is declared as __weak to be overwritten in case of other implementation in user file.
- Parameters:
TickPriority – Tick interrupt priority.
- Return values:
HAL – status
-
void HAL_IncTick(void)
This function is called to increment a global variable “uwTick” used as application time base.
Note
In the default implementation, this variable is incremented each 1ms in SysTick ISR.
Note
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Return values:
None –
-
void HAL_Delay(uint32_t Delay)
This function provides minimum delay (in milliseconds) based on variable incremented.
Note
In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals where uwTick is incremented.
Note
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Parameters:
Delay – specifies the delay time length, in milliseconds.
- Return values:
None –
-
void HAL_Delay_us(uint32_t us)
- void HAL_Delay_us_ (1 uint32_t us)
-
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
Note
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Return values:
tick – value
-
void HAL_SuspendTick(void)
Suspend Tick increment.
Note
In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Once HAL_SuspendTick() is called, the SysTick interrupt will be disabled and so Tick increment is suspended.
Note
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Return values:
None –
-
void HAL_ResumeTick(void)
Resume Tick increment.
Note
In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Once HAL_ResumeTick() is called, the SysTick interrupt will be enabled and so Tick increment is resumed.
Note
This function is declared as __weak to be overwritten in case of other implementations in user file.
- Return values:
None –
-
void HAL_AssertFailed(char *file, uint32_t line)
The assert failure printing. If BSP_USING_FULL_ASSERT is defined, the asser_failed function need to be implemented.
- Parameters:
file – file name of source code for the failed assert
line – code line number for the failed assert
- Return values:
None –
-
void HAL_sw_breakpoint(void)
Debug function to stop current thread execution.
- Return values:
None –
-
uint32_t HAL_DisableInterrupt(void)
-
void HAL_EnableInterrupt(uint32_t mask)
-
uint32_t HAL_GetLXTEnabled(void)
-
uint32_t HAL_GetElapsedTick(uint32_t prev_tick, uint32_t curr_tick)