Hardware Abstraction Layer (HAL)
PSoC 4 Implementation Specific

General Description

This section provides details about the PSoC 4 implementation of the Cypress HAL.

All information within this section is platform specific and is provided for reference. Portable application code should depend only on the APIs and types which are documented in the HAL Drivers section.

HAL Resource Hardware Mapping

The following table shows a mapping of each HAL driver to the lower level firmware driver and the corresponding hardware resource. This is intended to help understand how the HAL is implemented for PSoC 4 and what features the underlying hardware supports.

HAL Resource PDL Driver(s) PSoC 4 Hardware
ADC cy_adc SAR ADC
Clock cy_sysclk All clocks (system & peripheral)
Comparator cy_ctb or cy_lpcomp CTBm or LPComp
CRC cy_crypto_core_crc Crypto
DMA cy_dma, cy_dmac DMA Controller
EZI2C cy_scb_ezi2c SCB
Flash cy_flash Flash
GPIO cy_gpio GPIO
Hardware Manager NA NA
I2C cy_scb_i2c SCB
I2S cy_i2s I2S
LPTimer cy_mcwdt MCWDT
Opamp cy_ctb CTBm
PWM cy_pwm TCPWM
SPI cy_scb_spi SCB
SysPM cy_syspm System Power Resources
System cy_syslib System Resources
Timer cy_tcpwm_counter TCPWM
TRNG cy_crypto_core_trng Crypto
UART cy_scb_uart SCB
WDT cy_wdt WDT

Device Specific Errors

Error codes generated by the low level level PDL driver all use module IDs starting with CY_RSLT_MODULE_DRIVERS_PDL_BASE. The exact errors are documented for each driver in the psoc4pdl documentation.

API Reference

 Clocks
 Implementation specific interface for using the Clock driver.
 
 PSoC 4 Specific Hardware Types
 Aliases for types which are part of the public HAL interface but whose representations need to vary per HAL implementation.
 
 Pins
 Definitions for the pinout for each supported device.
 
 System Power Management
 The PSoC 6 Power Management has the following characteristics: CYHAL_SYSPM_SYSTEM_NORMAL equates to the Low Power mode
CYHAL_SYSPM_SYSTEM_LOW equates to the Ultra Low Power mode.
 
 Triggers
 Trigger connections for supported device families.
 
 DMA (Direct Memory Access)
 
 PWM (Pulse Width Modulator)
 
 WDT (Watchdog Timer)
 The PSoC 6 WDT is only capable of supporting certain timeout ranges below its maximum timeout of 6000ms.