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

General Description

Functions

uint8_t SelfTest_HWFILT3P3Z (PPCA_HWFILT3P3Z_SS_Type *base, uint8_t channel)
 Performs a self-test of a single HWFILT3P3Z filter channel by configuring it as a 2nd-order low-pass filter and verifying its frequency response: an in-band low-frequency tone must pass while an out-of-band high-frequency tone must be heavily attenuated.
uint8_t SelfTest_HWFILT3P3Z_HPPASS (uint8_t filtIdx)
 Performs a self-test of one HWFILT3P3Z filter instance inside the HPPASS (High Performance Programmable Analog Sub-System) on devices that provide CY_IP_MXS40MCPASS v3.

Function Documentation

◆ SelfTest_HWFILT3P3Z()

uint8_t SelfTest_HWFILT3P3Z ( PPCA_HWFILT3P3Z_SS_Type * base,
uint8_t channel )

Performs a self-test of a single HWFILT3P3Z filter channel by configuring it as a 2nd-order low-pass filter and verifying its frequency response: an in-band low-frequency tone must pass while an out-of-band high-frequency tone must be heavily attenuated.

This is the same method used by SelfTest_HWFILT3P3Z_HPPASS on the PSOC Control C3 M6 HPPASS variant.

Stages exercised: the AHB write path (DATA_IN0 trigger), the trigger / FILTER_BUSY logic, the AHB read of DATA_OUT, the forward and feedback multipliers, the accumulator, the coefficient scale factors, the output gain and limits, and the frequency-selective magnitude response of the IIR section. The original filter configuration is preserved and restored on return so that the test can be safely interleaved with application use of other channels in the same subsystem.

Note
The application is responsible for any system-level allocation of the HWFILT3P3Z subsystem to a CPU (PPSS_CNFG.CNFG0). The self-test enables the subsystem peripheral block and the selected filter instance through the standard PDL APIs and restores their previous enable state on return.
Parameters
baseHWFILT3P3Z subsystem instance: PPCA_HWFILT3P3Z_SS_0 (4 channels) or PPCA_HWFILT3P3Z_SS_1 (2 channels). Both share the register layout type PPCA_HWFILT3P3Z_SS_Type.
Note
PPCA_HWFILT3P3Z_SS_1 has a distinct PDL type and must be cast at the call site: SelfTest_HWFILT3P3Z((PPCA_HWFILT3P3Z_SS_Type*)PPCA_HWFILT3P3Z_SS_1, ch).
Parameters
channelFilter channel index within the subsystem. Valid range:
Returns
OK_STATUS (0) - Test passed
ERROR_STATUS (1) - HW self-test failed
ERROR_BAD_PARAM (9) - Invalid input parameters (no HW access performed)

◆ SelfTest_HWFILT3P3Z_HPPASS()

uint8_t SelfTest_HWFILT3P3Z_HPPASS ( uint8_t filtIdx)

Performs a self-test of one HWFILT3P3Z filter instance inside the HPPASS (High Performance Programmable Analog Sub-System) on devices that provide CY_IP_MXS40MCPASS v3.

The test validates the LPF frequency-response of the selected 3P3Z filter instance using two sub-tests driven entirely through the AHB interface:

  1. Low-frequency sub-test (omega = 2pi/40 rad/sample, amplitude = 2048). The waveform is stored as a 10-entry quarter-period table and reconstructed on-the-fly using sine symmetry (first quarter ascending, second quarter mirrored descending, second half negated first half). The LPF passes this in-band signal; the measured DATA_OUT peak must reach a minimum in-band threshold.
  2. High-frequency sub-test (omega = 2pi/5 rad/sample, same amplitude). The waveform is stored as a 5-entry fundamental-period table and reconstructed by periodic wrap (sample[n] = table[n % 5]). The LPF heavily attenuates this out-of-band signal; the measured peak must satisfy HWFILT3P3Z_ATT_RATIO * high_peak < low_peak.

Stages exercised: AHB write path (DATA_IN0 trigger), FILTER_BUSY handshake, AHB read of DATA_OUT, forward multipliers (cx0..cx3), feedback multipliers (cy1..cy3), 44-bit accumulator, coefficient scale factors (scaleCX, scaleCY), output gain (gOut), output limits (limMax, limMin) and the frequency-selective magnitude response of the IIR section. No DAC, ADC or Autonomous Controller hardware is required.

For filter theory (transfer function, cutoff frequency, test-tone gains and compressed sine tables) see Filter Theory.

Parameters
filtIdxFilter instance index. Valid range: 0..HWFILT3P3Z_HPPASS_MAX_IDX (0..2).
Returns
OK_STATUS (0) - Test passed
ERROR_STATUS (1) - Frequency response outside tolerance
ERROR_BAD_PARAM (9) - filtIdx out of range