MTB CAT1 Peripheral driver library

General Description

Functions

__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_FIFO_Config (const cy_stc_hppass_fifo_t *fifoCfg)
 Initializes the FIFO buffer. More...
 
__STATIC_INLINE uint8_t Cy_HPPASS_FIFO_GetSampleCount (uint8_t fifoIdx)
 Returns the number of accumulated data words. More...
 
__STATIC_INLINE int16_t Cy_HPPASS_FIFO_Read (uint8_t fifoIdx, uint8_t *chanIdx)
 Returns the FIFO data word and the channel index. More...
 
uint8_t Cy_HPPASS_FIFO_ReadAll (uint8_t fifoIdx, int16_t *data, uint8_t *chanIdxs)
 Loads all the FIFO payload into the array. More...
 
__STATIC_INLINE uint32_t Cy_HPPASS_FIFO_GetInterruptStatus (void)
 Gets the interrupt register status for the specified FIFO. More...
 
__STATIC_INLINE void Cy_HPPASS_FIFO_SetInterrupt (uint32_t interrupt)
 Sets a software interrupt request for the specified FIFO. More...
 
__STATIC_INLINE void Cy_HPPASS_FIFO_ClearInterrupt (uint32_t interrupt)
 Clears the interrupt for the specified FIFO. More...
 
__STATIC_INLINE void Cy_HPPASS_FIFO_SetInterruptMask (uint32_t interrupt)
 Enables the interrupt for the specified FIFO. More...
 
__STATIC_INLINE uint32_t Cy_HPPASS_FIFO_GetInterruptMask (void)
 Gets the interrupt mask for the specified FIFO. More...
 
__STATIC_INLINE uint32_t Cy_HPPASS_FIFO_GetInterruptStatusMasked (void)
 Gets all FIFOs interrupt masked status. More...
 

Function Documentation

◆ Cy_HPPASS_FIFO_Config()

__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_FIFO_Config ( const cy_stc_hppass_fifo_t fifoCfg)

Initializes the FIFO buffer.

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
fifoCfgPointer to the FIFO buffer structure cy_stc_hppass_fifo_t. The pointer cannot be NULL.
Returns
Status, cy_en_hppass_status_t.
Function Usage
{
.mode = CY_HPPASS_FIFO_1_32, /* Use single 32-entry FIFO buffer */
.trigMsk = 0U, /* Triggers disabled */
.level = {15, 0, 0, 0} /* Set level threshhold to 15 */
};
/* Scenario: Update FIFO configuration */
status = Cy_HPPASS_FIFO_Config(&fifoCfg);
/* Process returned status */

◆ Cy_HPPASS_FIFO_GetSampleCount()

__STATIC_INLINE uint8_t Cy_HPPASS_FIFO_GetSampleCount ( uint8_t  fifoIdx)

Returns the number of accumulated data words.

Parameters
fifoIdxThe index of the FIFO part. Valid range 0..3, but depends on cy_stc_hppass_fifo_t::mode setting.
Returns
the number of accumulated data words. If fifoIdx is out of range then zero is returned.
Function Usage
/* Scenario: Get the number of accumulated data words in FIFO#0 */
uint8_t sampleCount = Cy_HPPASS_FIFO_GetSampleCount(0U);
/* Process returned sampleCount */

◆ Cy_HPPASS_FIFO_Read()

__STATIC_INLINE int16_t Cy_HPPASS_FIFO_Read ( uint8_t  fifoIdx,
uint8_t *  chanIdx 
)

Returns the FIFO data word and the channel index.

Parameters
fifoIdxThe index of the FIFO part. Valid range 0..3, but depends on cy_stc_hppass_fifo_t::mode setting
chanIdxThe pointer to the variable to store channel index Channel Indexes. This is optional - the pointer may be NULL (if channel index is not needed).
Returns
the FIFO data word If fifoIdx is out of range then zero is returned.
Function Usage
/* Scenario: Read FIFO#0 values and channel indexes into arrays */
for (uint8_t i = 0U; i < sampleCount; i++)
{
data[i] = Cy_HPPASS_FIFO_Read(0U, &chanIdxs[i]);
}

◆ Cy_HPPASS_FIFO_ReadAll()

uint8_t Cy_HPPASS_FIFO_ReadAll ( uint8_t  fifoIdx,
int16_t *  data,
uint8_t *  chanIdxs 
)

Loads all the FIFO payload into the array.

Parameters
fifoIdxThe index of the FIFO buffer. Valid range 0..3, but depends on cy_stc_hppass_fifo_t::mode setting
dataPointer to the data array User is responsible for enough array size, it depends on cy_stc_hppass_fifo_t::mode setting
chanIdxsPointer to the array to store channel indexes Channel Indexes. User is responsible for enough array size, it depends on cy_stc_hppass_fifo_t::mode setting Also this is optional - the pointer may be NULL (if channel indexes are not needed).
Returns
the number of loaded data words
Function Usage
/* Scenario: Read all FIFO#0 values and channel indexes */
sampleCount = Cy_HPPASS_FIFO_ReadAll(0U, data, chanIdxs);
/* Process returned sampleCount */

◆ Cy_HPPASS_FIFO_GetInterruptStatus()

__STATIC_INLINE uint32_t Cy_HPPASS_FIFO_GetInterruptStatus ( void  )

Gets the interrupt register status for the specified FIFO.

Returns
The status of combined interrupt requests for the FIFO Group_hppass_fifo_level_interrupts.
Function Usage
/* Scenario: Read FIFO interrupt status */
/* Process returned interrupt status of combined requests */

◆ Cy_HPPASS_FIFO_SetInterrupt()

__STATIC_INLINE void Cy_HPPASS_FIFO_SetInterrupt ( uint32_t  interrupt)

Sets a software interrupt request for the specified FIFO.

Note
This function works slightly different than any regular _SetInterrupt function (for example Cy_HPPASS_SetInterrupt), because of different HPPASS_FIFO_INTR/INTR_SET level-based register behavior. See TRM for details.
Parameters
interruptThe mask of interrupts to be set. Each bit of this mask is responsible for triggering of the particular interrupt in the FIFO Group_hppass_fifo_level_interrupts.
Function Usage
/* Scenario: Activate FIFO#1 level interrupt */

◆ Cy_HPPASS_FIFO_ClearInterrupt()

__STATIC_INLINE void Cy_HPPASS_FIFO_ClearInterrupt ( uint32_t  interrupt)

Clears the interrupt for the specified FIFO.

Note
This function works slightly different than any regular _ClearInterrupt function (for example Cy_HPPASS_ClearInterrupt), because of different HPPASS_FIFO_INTR/INTR_SET level-based registers behavior. See TRM for details.
Parameters
interruptThe mask of interrupts to be cleared. Each bit of this mask is responsible for triggering of the particular interrupt in the FIFO Group_hppass_fifo_level_interrupts.
Function Usage
/* Scenario: Clear FIFO level interrupt */

◆ Cy_HPPASS_FIFO_SetInterruptMask()

__STATIC_INLINE void Cy_HPPASS_FIFO_SetInterruptMask ( uint32_t  interrupt)

Enables the interrupt for the specified FIFO.

Parameters
interruptThe mask of interrupts allowable for activation. Each bit of this mask allows triggering of the particular interrupt in the FIFO Group_hppass_fifo_level_interrupts.
Function Usage
/* Scenario: Enable the FIFO#1 interrupt */

◆ Cy_HPPASS_FIFO_GetInterruptMask()

__STATIC_INLINE uint32_t Cy_HPPASS_FIFO_GetInterruptMask ( void  )

Gets the interrupt mask for the specified FIFO.

Returns
The mask of the interrupts allowable for activation Group_hppass_fifo_level_interrupts.
Function Usage
/* Scenario: Get combined FIFO interrupt mask */
/* Process returned mask */

◆ Cy_HPPASS_FIFO_GetInterruptStatusMasked()

__STATIC_INLINE uint32_t Cy_HPPASS_FIFO_GetInterruptStatusMasked ( void  )

Gets all FIFOs interrupt masked status.

Returns
The masked status of combined interrupt requests for the FIFO Group_hppass_fifo_level_interrupts.
Function Usage
/* Scenario: Get all FIFOs interrupt masked status */
/* Process returned status */