Hardware Abstraction Layer (HAL)

General Description

This section documents the basic types that are used by multiple HAL drivers.

API Reference

 Result Codes
 HAL specific return codes definitions for all drivers.
 
 System Power Management
 Interface for changing power states and restricting when they are allowed.
 
 Clock
 Interface for getting and changing clock configuration.
 

Enumerations

enum  cyhal_async_mode_t {
  CYHAL_ASYNC_DMA,
  CYHAL_ASYNC_SW
}
 group_hal_results More...
 
enum  cyhal_power_level_t {
  CYHAL_POWER_LEVEL_OFF,
  CYHAL_POWER_LEVEL_LOW,
  CYHAL_POWER_LEVEL_MEDIUM,
  CYHAL_POWER_LEVEL_HIGH,
  CYHAL_POWER_LEVEL_DEFAULT
}
 Selectable power levels. More...
 

Enumeration Type Documentation

◆ cyhal_async_mode_t

group_hal_results

Modes that can be used for asynchronous transfers

Enumerator
CYHAL_ASYNC_DMA 

Use DMA if available.

Otherwise fall back to software transfer. (Default)

CYHAL_ASYNC_SW 

Always perform a software transfer.

◆ cyhal_power_level_t

Selectable power levels.

Power levels are defined relative to others. Higher power levels offer better performance but consume more power.

Not all hardware supports four discrete power levels. If fewer power levels are supported, the values will be mapped as follows:

4 Levels 3 Levels 2 Levels
Off Off Off
Low Low = Medium Low = Medium = High = Default
Medium High = Default
High = Default

See the implementation specific documentation for details.

Enumerator
CYHAL_POWER_LEVEL_OFF 

Power-off the comparator, while retaining configuration.

CYHAL_POWER_LEVEL_LOW 

Low comparator power and speed.

CYHAL_POWER_LEVEL_MEDIUM 

Medium comparator power and speed.

CYHAL_POWER_LEVEL_HIGH 

High comparator power and speed.

CYHAL_POWER_LEVEL_DEFAULT 

Default comparator power and speed.