PSoC 6 Hardware Abstraction Layer (HAL)
PSoC 6 Implementation Specific

General Description

This section provides details about the PSoC 6 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.

API Reference

 Implementation-defined types
 
 Pins
 
 SCB Common Functionality
 
 TCPWM Common Functionality
 
 WDT (Watchdog Timer)
 

Macros

#define CYHAL_IRQN_OFFSET   16
 
#define CYHAL_GET_CURRENT_IRQN()   ((IRQn_Type) (__get_IPSR() - CYHAL_IRQN_OFFSET))
 

Functions

static uint32_t cyhal_divider_value (uint32_t frequency, uint32_t frac_bits)
 

Macro Definition Documentation

◆ CYHAL_IRQN_OFFSET

#define CYHAL_IRQN_OFFSET   16

Offset for implementation-defined ISR type numbers (IRQ0 = 16)

◆ CYHAL_GET_CURRENT_IRQN

#define CYHAL_GET_CURRENT_IRQN ( )    ((IRQn_Type) (__get_IPSR() - CYHAL_IRQN_OFFSET))

Macro to get the IRQn of the current ISR

Function Documentation

◆ cyhal_divider_value()

static uint32_t cyhal_divider_value ( uint32_t  frequency,
uint32_t  frac_bits 
)
inlinestatic

Calculate the peri clock divider value that need to be set to reach frequency closest to the input frequency

Parameters
[in]frequencyThe desired frequency
[in]frac_bitsThe number of fractional bits that the divider has
Returns
The calculate divider value to set, NOTE a divider value of x divide the frequency by (x+1)