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.
|
typedef unsigned | halclkpt_t |
| Type of a clock point identifier.
|
typedef uint32_t | halfreq_t |
| Type of a clock point frequency in Hz.
|
◆ __CHIBIOS_HAL__
ChibiOS/HAL identification macro.
Definition at line 41 of file hal.h.
◆ CH_HAL_STABLE
Stable release flag.
Definition at line 46 of file hal.h.
◆ CH_HAL_VERSION
#define CH_HAL_VERSION "9.0.0" |
HAL version string.
Definition at line 55 of file hal.h.
◆ CH_HAL_MAJOR
HAL version major number.
Definition at line 60 of file hal.h.
◆ CH_HAL_MINOR
HAL version minor number.
Definition at line 65 of file hal.h.
◆ CH_HAL_PATCH
HAL version patch number.
Definition at line 70 of file hal.h.
◆ HAL_SUCCESS
#define HAL_SUCCESS false |
HAL operation success.
- Deprecated
Definition at line 81 of file hal.h.
Referenced by _sdc_wait_for_transfer_state_internal(), mmc_detect_bus_clk(), mmc_init(), mmc_read(), mmc_read_CxD(), mmc_recvr1(), mmc_send_hdr(), mmc_set_bus_width(), mmc_wait_idle(), mmc_write(), mmcConnect(), mmcDisconnect(), mmcErase(), mmcGetInfo(), mmcSequentialRead(), mmcStartSequentialRead(), mmcStartSequentialWrite(), mmcStopSequentialRead(), mmcStopSequentialWrite(), mode_detect(), sdc_cmd6_check_status(), sdc_detect_bus_clk(), sdc_init(), sdc_lld_read(), sdc_lld_send_cmd_long_crc(), sdc_lld_send_cmd_short(), sdc_lld_send_cmd_short_crc(), sdc_lld_sync(), sdc_lld_write(), sdc_set_bus_width(), sdcConnect(), sdcDisconnect(), sdcErase(), and sdcGetInfo().
◆ HAL_FAILED
HAL operation failed.
- Deprecated
Definition at line 86 of file hal.h.
Referenced by _sdc_wait_for_transfer_state_internal(), mmc_init(), mmc_read(), mmc_read_CxD(), mmc_recvr1(), mmc_send_hdr(), mmc_set_bus_width(), mmc_wait_idle(), mmc_write(), mmcConnect(), mmcErase(), mmcGetInfo(), mmcSequentialRead(), mmcSequentialWrite(), mmcStartSequentialRead(), mmcStartSequentialWrite(), mmcStopSequentialRead(), mmcStopSequentialWrite(), mmcSync(), mode_detect(), sdc_cmd6_check_status(), sdc_detect_bus_clk(), sdc_init(), sdc_set_bus_width(), sdcConnect(), sdcDisconnect(), sdcErase(), sdcGetInfo(), sdcRead(), sdcSync(), and sdcWrite().
◆ HAL_RET_SUCCESS
#define HAL_RET_SUCCESS MSG_OK |
Definition at line 93 of file hal.h.
Referenced by __buffered_serial_ctl_impl(), __ctl(), _ctl(), adcStart(), bsioStart(), canStart(), cryStart(), dacConvert(), dacPutChannelX(), dacStart(), dacStartConversion(), dacStartConversionI(), eflStart(), gptStart(), i2cStart(), i2sStart(), icuStart(), macStart(), mmcStart(), pwmStart(), sdcStart(), sdStart(), sduStart(), sio_lld_start(), sioStart(), spi_lld_exchange(), spi_lld_ignore(), spi_lld_receive(), spi_lld_send(), spi_lld_start(), spi_lld_stop_transfer(), spiStart(), spiStartExchangeI(), spiStartIgnoreI(), spiStartReceiveI(), spiStartSendI(), spiStopTransferI(), trngStart(), uartStart(), usbStart(), wdgStart(), and wspiStart().
◆ HAL_RET_CONFIG_ERROR
#define HAL_RET_CONFIG_ERROR (msg_t)-16 |
Configuration error.
An error has been detected in the driver configuration structure.
Definition at line 98 of file hal.h.
◆ HAL_RET_NO_RESOURCE
#define HAL_RET_NO_RESOURCE (msg_t)-17 |
A required resource is not available.
One of the resources required for driver operations is not available.
Definition at line 104 of file hal.h.
◆ HAL_RET_HW_BUSY
#define HAL_RET_HW_BUSY (msg_t)-18 |
The peripheral is busy.
The peripheral is not available or taken by some other system actor.
Definition at line 110 of file hal.h.
◆ HAL_RET_HW_FAILURE
#define HAL_RET_HW_FAILURE (msg_t)-19 |
Peripheral failure.
Peripheral failed, for example HW timeouts.
Definition at line 115 of file hal.h.
◆ HAL_RET_UNKNOWN_CTL
#define HAL_RET_UNKNOWN_CTL (msg_t)-20 |
◆ HAL_RET_IS_INVALID
#define HAL_RET_IS_INVALID (msg_t)-21 |
◆ HAL_USE_PAL
#define HAL_USE_PAL FALSE |
◆ HAL_USE_ADC
#define HAL_USE_ADC FALSE |
◆ HAL_USE_CAN
#define HAL_USE_CAN FALSE |
◆ HAL_USE_CRY
#define HAL_USE_CRY FALSE |
◆ HAL_USE_DAC
#define HAL_USE_DAC FALSE |
◆ HAL_USE_EFL
#define HAL_USE_EFL FALSE |
◆ HAL_USE_GPT
#define HAL_USE_GPT FALSE |
◆ HAL_USE_I2C
#define HAL_USE_I2C FALSE |
◆ HAL_USE_I2S
#define HAL_USE_I2S FALSE |
◆ HAL_USE_ICU
#define HAL_USE_ICU FALSE |
◆ HAL_USE_MAC
#define HAL_USE_MAC FALSE |
◆ HAL_USE_PWM
#define HAL_USE_PWM FALSE |
◆ HAL_USE_RTC
#define HAL_USE_RTC FALSE |
◆ HAL_USE_SERIAL
#define HAL_USE_SERIAL FALSE |
◆ HAL_USE_SDC
#define HAL_USE_SDC FALSE |
◆ HAL_USE_SIO
#define HAL_USE_SIO FALSE |
◆ HAL_USE_SPI
#define HAL_USE_SPI FALSE |
◆ HAL_USE_TRNG
#define HAL_USE_TRNG FALSE |
◆ HAL_USE_UART
#define HAL_USE_UART FALSE |
◆ HAL_USE_USB
#define HAL_USE_USB FALSE |
◆ HAL_USE_WDG
#define HAL_USE_WDG FALSE |
◆ HAL_USE_WSPI
#define HAL_USE_WSPI FALSE |
◆ HAL_LLD_SELECT_SPI_V2
#define HAL_LLD_SELECT_SPI_V2 TRUE |
Requires use of SPIv2 driver model.
Definition at line 35 of file hal_lld.h.
◆ HAL_LLD_USE_CLOCK_MANAGEMENT
#define HAL_LLD_USE_CLOCK_MANAGEMENT |
Specifies implementation of dynamic clock management.
Definition at line 40 of file hal_lld.h.
◆ PLATFORM_NAME
#define PLATFORM_NAME "templates" |
◆ halclkpt_t
Type of a clock point identifier.
Definition at line 239 of file hal.h.
◆ halfreq_t
Type of a clock point frequency in Hz.
Definition at line 244 of file hal.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:
- Object or module nitializer function.
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().
◆ 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 278 of file hal.h.
References hal_lld_get_clock_point().
◆ halClockSwitchMode()
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 296 of file hal.h.
References hal_lld_clock_switch_mode().
◆ 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().