ModusToolbox Safety Test Library
Loading...
Searching...
No Matches

General Description

Functions

uint8_t SelfTest_PWM (GPIO_PRT_Type *pinbase, uint32_t pinNum)
 This function performs the PWM test and verifies that the duty cycle set is actually achieved in the output.
uint8_t SelfTest_PWM_init (TCPWM_Type *base, uint32_t cntNum, cy_stc_tcpwm_pwm_config_t const *config, IRQn_Type intr_src)
 Initialize Timer interrupt for the Self test.
void SelfTest_PWM_DeInit (IRQn_Type intr_src)
 De-initialize the PWM self test, disabling the peripheral and its interrupt.

Function Documentation

◆ SelfTest_PWM()

uint8_t SelfTest_PWM ( GPIO_PRT_Type * pinbase,
uint32_t pinNum )

This function performs the PWM test and verifies that the duty cycle set is actually achieved in the output.

Parameters
pinbaseThe pointer to the GPIO port instance to which the PWM pin is connected.
pinNumThe GPIO pin number to which the PWM pin is connected.
Note
The pin parameters passed for XMC7000, XMC5000, and PSOC Control C3 devices will be ignored. Use a PWM/TCPWM instance dedicated to the self-test while the test is running; the measurement depends on the interrupt configured by SelfTest_PWM_init.
Returns
OK_STATUS (0) - Test passed
ERROR_STATUS (1) - Test failed

◆ SelfTest_PWM_init()

uint8_t SelfTest_PWM_init ( TCPWM_Type * base,
uint32_t cntNum,
cy_stc_tcpwm_pwm_config_t const * config,
IRQn_Type intr_src )

Initialize Timer interrupt for the Self test.

Parameters
baseThe pointer to a TCPWM instance.
cntNumThe Counter instance number in the selected TCPWM.
configThe pointer to the configuration structure.
intr_srcInterrupt source
Note
This function initializes the selected PWM counter, installs the self-test ISR, enables the interrupt, and starts the counter. Do not share the selected PWM counter or interrupt source with application PWM control during the test.
Returns
OK_STATUS (0) - Initialization successful
PWM_INIT_ERROR_STATUS (255) - Initialization failed

◆ SelfTest_PWM_DeInit()

void SelfTest_PWM_DeInit ( IRQn_Type intr_src)

De-initialize the PWM self test, disabling the peripheral and its interrupt.

Parameters
intr_srcInterrupt source passed to SelfTest_PWM_init.