Hardware Abstraction Layer.
More...
Hardware Abstraction Layer.
The HAL (Hardware Abstraction Layer) driver performs the system initialization and includes the platform support code shared by the other drivers. This driver does contain any API function except for a general initialization function halInit()
that must be invoked before any HAL service can be used, usually the HAL initialization should be performed immediately before the kernel initialization.
Some HAL driver implementations also offer a custom early clock setup function that can be invoked before the C runtime initialization in order to accelerate the startup time.
|
#define | PLATFORM_NAME "templates" |
|
◆ __CHIBIOS_HAL__
ChibiOS/HAL identification macro.
Definition at line 42 of file hal.h.
◆ CH_HAL_STABLE
Stable release flag.
Definition at line 47 of file hal.h.
◆ HAL_VERSION
#define HAL_VERSION "7.2.0" |
HAL version string.
Definition at line 56 of file hal.h.
◆ CH_HAL_MAJOR
HAL version major number.
Definition at line 61 of file hal.h.
◆ CH_HAL_MINOR
HAL version minor number.
Definition at line 66 of file hal.h.
◆ CH_HAL_PATCH
HAL version patch number.
Definition at line 71 of file hal.h.
◆ HAL_SUCCESS
#define HAL_SUCCESS false |
HAL operation success.
Definition at line 81 of file hal.h.
◆ HAL_FAILED
HAL operation failed.
Definition at line 85 of file hal.h.
◆ HAL_LLD_USE_CLOCK_MANAGEMENT
#define HAL_LLD_USE_CLOCK_MANAGEMENT |
Specifies implementation of dynamic clock management.
Definition at line 35 of file hal_lld.h.
◆ halclkpt_t
Type of a clock point identifier.
Definition at line 72 of file hal_lld.h.
◆ halfreq_t
Type of a clock point frequency in Hz.
Definition at line 78 of file hal_lld.h.
◆ halInit()
HAL initialization.
This function invokes the low level initialization code then initializes all the drivers enabled in the HAL. Finally the board-specific initialization is performed by invoking boardInit()
(usually defined in board.c
).
- Function Class:
- Initializer, this function just initializes an object and can be invoked before the kernel is initialized.
Definition at line 56 of file hal.c.
References adcInit(), canInit(), cryInit(), dacInit(), eflInit(), gptInit(), hal_lld_init(), i2cInit(), i2sInit(), icuInit(), macInit(), mmcInit(), osalInit(), palInit, pwmInit(), rtcInit(), sdcInit(), sdInit(), sduInit(), sioInit(), spiInit(), stInit(), trngInit(), uartInit(), usbInit(), wdgInit(), and wspiInit().
◆ halClockSwitchMode()
static bool halClockSwitchMode |
( |
const halclkcfg_t * |
ccp | ) |
|
|
inlinestatic |
Switches to a different clock configuration.
- Parameters
-
- Returns
- The clock switch result.
- Return values
-
false | if the clock switch succeeded |
true | if the clock switch failed |
- Function Class:
- Special function, this function has special requirements see the notes.
Definition at line 229 of file hal.h.
References hal_lld_clock_switch_mode().
◆ halClockGetPointX()
Returns the frequency of a clock point in Hz.
- Parameters
-
[in] | clkpt | clock point to be returned |
- Returns
- The clock point frequency in Hz or zero if the frequency is unknown.
- Function Class:
- This is an X-Class API, this function can be invoked from any context.
Definition at line 243 of file hal.h.
References hal_lld_get_clock_point().
◆ hal_lld_init()
void hal_lld_init |
( |
void |
| ) |
|
Low level HAL driver initialization.
- Function Class:
- Not an API, this function is for internal use only.
Definition at line 72 of file hal_lld.c.
Referenced by halInit().
◆ hal_lld_clock_switch_mode()
bool hal_lld_clock_switch_mode |
( |
const halclkcfg_t * |
ccp | ) |
|
Switches to a different clock configuration.
- Parameters
-
- Returns
- The clock switch result.
- Return values
-
false | if the clock switch succeeded |
true | if the clock switch failed |
- Function Class:
- Not an API, this function is for internal use only.
Definition at line 87 of file hal_lld.c.
Referenced by halClockSwitchMode().
◆ hal_lld_get_clock_point()
Returns the frequency of a clock point in Hz.
- Parameters
-
[in] | clkpt | clock point to be returned |
- Returns
- The clock point frequency in Hz or zero if the frequency is unknown.
- Function Class:
- Not an API, this function is for internal use only.
Definition at line 103 of file hal_lld.c.
Referenced by halClockGetPointX().