MTB CAT1 Peripheral driver library

General Description

Functions

__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_SAR_FirConfig (uint8_t firIdx, const cy_stc_hppass_fir_t *firCfg)
 Initializes the ADC FIR filter. More...
 
__STATIC_INLINE int16_t Cy_HPPASS_SAR_Result_FirRead (uint8_t firIdx)
 Returns the the ADC FIR filter result. More...
 

Function Documentation

◆ Cy_HPPASS_SAR_FirConfig()

__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_SAR_FirConfig ( uint8_t  firIdx,
const cy_stc_hppass_fir_t firCfg 
)

Initializes the ADC FIR filter.

Note
If AC is running this configuration is not allowed (CY_HPPASS_AC_INVALID_STATE will be returned).
If the SAR block is currently busy the initialization is not allowed (CY_HPPASS_SAR_INVALID_STATE will be returned).
Since the 'block ready' status is combined SAR and CSG, this particular SAR function cannot be protected from reinitialization during the 'block ready' == true condition, so it is on user's responsibility when and from where to call this function to reconfigure this SAR sub-block.
Parameters
firIdxThe index of the FIR filter instance. Valid range 0..1.
firCfgPointer to the FIR filter configuration structure cy_stc_hppass_fir_t. The pointer cannot be NULL.
Returns
Status, cy_en_hppass_status_t.
Function Usage
const cy_stc_hppass_fir_t firCfg =
{
.chan = CY_HPPASS_FIR_CHAN_0, /* Use FIR channel #0 */
/* Do not wait for 16 samples before the output is stored into a FIR_RESULT register */
.waitTapInit = false,
/* Test filter coeficients. Need to be updated, if particular filter type is needed. */
.coef = {0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000},
.limit = CY_HPPASS_SAR_LIMIT_DISABLED, /* Limits are disabled */
.result = true, /* FIR result is exposed to read */
.fifo = CY_HPPASS_FIFO_0 /* Use FIFO#0 */
};
/* Scenario: Configure FIR#0 */
status = Cy_HPPASS_SAR_FirConfig(0U, &firCfg);
/* Process returned status */

◆ Cy_HPPASS_SAR_Result_FirRead()

__STATIC_INLINE int16_t Cy_HPPASS_SAR_Result_FirRead ( uint8_t  firIdx)

Returns the the ADC FIR filter result.

Parameters
firIdxThe index of the FIR filter instance. Valid range 0..1.
Returns
FIR filter result
Function Usage
/* Scenario: Read filtered result from FIR#1 */
int16_t firResult = Cy_HPPASS_SAR_Result_FirRead(1U);
/* Process returned firResult */