Code shared between the Cypress Timer / Counter and PWM.
◆ 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) |
◆ cyhal_tcpwm_event_callback_t
| typedef void(* cyhal_tcpwm_event_callback_t) (void *callback_arg, int event) |
Handler for TCPWM interrupts
◆ cyhal_tcpwm_init_callback_data()
Initialize a timer/counter or PWM object's callback data.
- Parameters
-
| [in] | resource | The timer/counter or PWM resource |
| [in,out] | callback_data | The 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] | resource | The timer/counter or PWM resource |
| [in] | callback | The callback handler which will be invoked when the event occurs |
| [in] | callback_arg | Generic 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] | type | The type of the timer/counter or PWM |
| [in] | resource | The timer/counter or PWM resource |
| [in] | event | The timer/counter or PWM event type |
| [in] | intrPriority | The priority for NVIC interrupt events |
| [in] | enable | True to turn on events, False to turn off |
◆ CYHAL_TCPWM_DATA
Contains data about all of the TCPWMs