CAT2 Peripheral Driver Library

Functions

cy_en_trigmux_status_t Cy_TrigMux_Connect (uint32_t inTrig, uint32_t outTrig)
 Connects an input trigger source and output trigger. More...
 
cy_en_trigmux_status_t Cy_TrigMux_SwTrigger (uint32_t trigLine, uint32_t cycles)
 This function generates a software trigger on an input trigger line. More...
 

Detailed Description

Function Documentation

◆ Cy_TrigMux_Connect()

cy_en_trigmux_status_t Cy_TrigMux_Connect ( uint32_t  inTrig,
uint32_t  outTrig 
)

Connects an input trigger source and output trigger.

Parameters
inTrigAn input selection for the trigger mux.
  • Bit 30 should be cleared.
  • Bits 11:8 represent the trigger group selection.
  • Bits 6:0 select the input trigger signal for the specified trigger multiplexer.
outTrigThe output of the trigger mux. This refers to the consumer of the trigger mux.
  • Bit 30 should be set.
  • Bits 11:8 represent the trigger group selection.
  • Bits 6:0 select the output trigger number in the trigger group.
Returns
status:
  • CY_TRIGMUX_SUCCESS: The connection is made successfully.
  • CY_TRIGMUX_BAD_PARAM: Some parameter is invalid.
Function Usage
/* Scenario: Setup a trigger multiplexer connection from TCPWM counter 0 overflow output to CPUSS 0 channel 0 trigger input.
*/
(void)Cy_TrigMux_Connect(TRIG0_IN_TCPWM_TR_OVERFLOW0, TRIG0_OUT_CPUSS_DMAC_TR_IN0);
/* Note: the Cy_TrigMux_Connect return status is ignored here because the provided parameters are correct.
* It is made here just to reduce the code snippet redundancy, it is not recommended to do so in the user code.
*/

◆ Cy_TrigMux_SwTrigger()

cy_en_trigmux_status_t Cy_TrigMux_SwTrigger ( uint32_t  trigLine,
uint32_t  cycles 
)

This function generates a software trigger on an input trigger line.

All output triggers connected to this input trigger will be triggered. The function also verifies that there is no activated trigger before generating another activation.

Parameters
trigLineThe input of the trigger mux.
  • Bit 30 represents if the signal is an input/output. When this bit is set, the trigger activation is for an output trigger from the trigger multiplexer. When this bit is reset, the trigger activation is for an input trigger to the trigger multiplexer.
  • Bits 11:8 represent the trigger group selection.
    In case of output trigger line (bit 30 is set):
  • Bits 6:0 select the output trigger number in the trigger group. In case of input trigger line (bit 30 is unset):
  • Bits 6:0 select the input trigger signal for the trigger multiplexer.
cyclesThe number of "Clk_Peri" cycles during which the trigger remains activated.
The valid range of cycles is 1 ... 254.
Also there are special values:
  • CY_TRIGGER_INFINITE - trigger remains activated until the user deactivates it by calling this function with CY_TRIGGER_DEACTIVATE parameter.
  • CY_TRIGGER_DEACTIVATE - this is used to deactivate the trigger activated by calling this function with CY_TRIGGER_INFINITE parameter.
Returns
status:
  • CY_TRIGMUX_SUCCESS: The trigger is successfully activated/deactivated.
  • CY_TRIGMUX_INVALID_STATE: The trigger is already activated/not active.
Function Usage
#define CY_TRIGGER_THREE_CYCLES (3U)
/* Scenario: Software Trigger the CPUSS channel 0 */
if (CY_TRIGMUX_SUCCESS != Cy_TrigMux_SwTrigger(TRIG0_OUT_CPUSS_DMAC_TR_IN0, CY_TRIGGER_THREE_CYCLES))
{
/* Insert error handling */
}