MTB CAT5 Peripheral driver library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

General Description

Driver API for PWM.

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

Use PWM mode when an output square wave is needed with a specific period and duty cycle, such as:

The PWM has the following features:

Configuration Considerations

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

Configure PWM

To configure PWM, provide the configuration parameters in the cy_stc_tcpwm_pwm_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_PWM_Init function providing a pointer to the populated cy_stc_tcpwm_pwm_config_t structure.

For TCPWM V1 Configuration

For 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 PWM

PWM has to be enabled before starting

Start PWM

PWM has to be started

API Reference

 Macros
 
 Functions
 
 Data Structures