PSoC 6 Hardware Abstraction Layer (HAL)
TCPWM Common Functionality

General Description

Code shared between the Cypress Timer / Counter and PWM.

Data Structures

struct  cyhal_tcpwm_data_t
 

Typedefs

typedef void(* cyhal_tcpwm_event_callback_t) (void *callback_arg, int event)
 

Functions

void cyhal_tcpwm_init_callback_data (cyhal_resource_inst_t *resource, cyhal_event_callback_data_t *callback_data)
 
void cyhal_tcpwm_register_callback (cyhal_resource_inst_t *resource, cy_israddress callback, void *callback_arg)
 
void cyhal_tcpwm_enable_event (TCPWM_Type *type, cyhal_resource_inst_t *resource, uint32_t event, uint8_t intrPriority, bool enable)
 

Variables

const cyhal_tcpwm_data_t CYHAL_TCPWM_DATA [CY_IP_MXTCPWM_INSTANCES]
 

Data Structure Documentation

◆ cyhal_tcpwm_data_t

struct cyhal_tcpwm_data_t
Data Fields
TCPWM_Type * base TCPWM base.
en_clk_dst_t clock_dst TCPWM clock connections base.
uint32_t max_count TCPWM counter width.
uint8_t num_channels Number of channels on the TCPWM.
uint8_t channel_offset Offset from channels on previous TCPWM.
uint8_t isr_offset TCPWM base IRQn (channel 0 IRQn)

Typedef Documentation

◆ cyhal_tcpwm_event_callback_t

typedef void(* cyhal_tcpwm_event_callback_t) (void *callback_arg, int event)

Handler for TCPWM interrupts

Function Documentation

◆ cyhal_tcpwm_init_callback_data()

void cyhal_tcpwm_init_callback_data ( cyhal_resource_inst_t *  resource,
cyhal_event_callback_data_t *  callback_data 
)

Initialize a timer/counter or PWM object's callback data.

Parameters
[in]resourceThe timer/counter or PWM resource
[in,out]callback_dataThe callback data object belonging to the timer/counter or PWM

◆ cyhal_tcpwm_register_callback()

void cyhal_tcpwm_register_callback ( cyhal_resource_inst_t *  resource,
cy_israddress  callback,
void *  callback_arg 
)

The TCPWM interrupt handler registration

Parameters
[in]resourceThe timer/counter or PWM resource
[in]callbackThe callback handler which will be invoked when the event occurs
[in]callback_argGeneric argument that will be provided to the callback when called

◆ cyhal_tcpwm_enable_event()

void cyhal_tcpwm_enable_event ( TCPWM_Type *  type,
cyhal_resource_inst_t *  resource,
uint32_t  event,
uint8_t  intrPriority,
bool  enable 
)

Configure TCPWM event enablement.

Parameters
[in]typeThe type of the timer/counter or PWM
[in]resourceThe timer/counter or PWM resource
[in]eventThe timer/counter or PWM event type
[in]intrPriorityThe priority for NVIC interrupt events
[in]enableTrue to turn on events, False to turn off

Variable Documentation

◆ CYHAL_TCPWM_DATA

const cyhal_tcpwm_data_t CYHAL_TCPWM_DATA[CY_IP_MXTCPWM_INSTANCES]

Contains data about all of the TCPWMs