MTB CAT5 Peripheral driver library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Timer/Counter (TCPWM)

General Description

Driver API for Timer/Counter.

The functions and other declarations used in this part of the driver are in cy_tcpwm_counter.h. You can also include cy_pdl.h to get access to all functions and declarations in the PDL.

Use Timer/Counter mode whenever a specific timing interval or measurement is needed. Examples include:

The Timer/Counter has the following features:

Configuration Considerations

The Counter configuration can be divided to number of sequential steps listed below:

Configure Counter

To configure Counter, provide the configuration parameters in the cy_stc_tcpwm_counter_config_t structure. The Configuration structure can be modified through software, but if the configurator in ModusToolbox is used then the configuration structure will be updated with the users input. To initialize the driver, call Cy_TCPWM_Counter_Init function providing a pointer to the populated cy_stc_tcpwm_counter_config_t structure.

For TCPWM V1 Configuration

TCPWM V2 Configuration

Assign Clock Divider

The clock source must be connected to proper working. Any of the peripheral clock dividers could be used. Use the SysClk (System Clock) driver API to do that.

Enable Counter

Counter has to be enabled before starting

Start Counter

Counter has to be started

API Reference

 Macros
 
 Functions
 
 Data Structures