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_edge_type_t {
  CYHAL_EDGE_TYPE_RISING_EDGE ,
  CYHAL_EDGE_TYPE_FALLING_EDGE ,
  CYHAL_EDGE_TYPE_BOTH_EDGES ,
  CYHAL_EDGE_TYPE_LEVEL
}
 Enum of signal edge types. 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...
 
enum  cyhal_signal_type_t {
  CYHAL_SIGNAL_TYPE_LEVEL = 0 ,
  CYHAL_SIGNAL_TYPE_EDGE = 1
}
 Signal trigger type. 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_edge_type_t

Enum of signal edge types.

Enumerator
CYHAL_EDGE_TYPE_RISING_EDGE 

Rising edge.

CYHAL_EDGE_TYPE_FALLING_EDGE 

Falling edge.

CYHAL_EDGE_TYPE_BOTH_EDGES 

Both edges.

CYHAL_EDGE_TYPE_LEVEL 

Level.

◆ 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.

◆ cyhal_signal_type_t

Signal trigger type.

Enumerator
CYHAL_SIGNAL_TYPE_LEVEL 

Level triggered.

CYHAL_SIGNAL_TYPE_EDGE 

Edge triggered.