PSOC E8XXGP Device Support Library
TrigMux (Trigger Multiplexer)

General Description

The trigger multiplexer provides access to the multiplexer that selects a set of trigger output signals from different peripheral blocks to route them to the specific trigger input of another peripheral block.

The functions and other declarations used in this driver are in cy_trigmux.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.

The TrigMux driver is based on the trigger multiplexer's hardware block. The Trigger multiplexer block consists of multiple trigger multiplexers. These trigger multiplexers are grouped in trigger groups. All the trigger multiplexers in the trigger group share similar input options.

The trigger multiplexer groups structure is flat - all the groups are essentially distribution multiplexers (there are no any intermediate trigger signals), so the structure is simpler in comparison with PERI_ver1, however a bit less flexible. Additionally there are another type of trigger interconnections: one-to-one trigger lines. These are not multiplexers, only single trigger wires from/to the dedicated peripherals. Multiple groups of one-to-one trigger lines significantly improve the whole triggering interconnect system flexibility.

The trigger architecture of the PSoC device is explained in the technical reference manual (TRM). Refer to the TRM to better understand the trigger multiplexer routing architecture available.

Configuration Considerations

To route a trigger signal from one peripheral in the PSoC device to another, the user can configure either a trigger multiplexer using Cy_TrigMux_Connect or a one-to-one trigger line using Cy_TrigMux_Select. Only one function call is required to connect one peripheral to another (unlike for PERI_ver1).

The Cy_TrigMux_Connect() function has two main parameters, inTrig and outTrig that refer to the input and output trigger lines connected using the multiplexer. These parameters are represented in the following format:

In addition, the Cy_TrigMux_Connect function also has an invert and trigger type parameter. Refer to the API reference for a detailed description of this parameter. All the constants associated with the different trigger signals in the system (input and output) are defined as constants in the device configuration header file.

There are two types of TrigMux signal definitions in the device configuration header: 1) The parameters for the trigger interconnection system input signals. 2) The parameters for the trigger interconnection system output signals. Also there are separate groups of trigger multiplexer input/outputs and groups of trigger one-to-one line input/outputs.

Refer to the TRM for a more detailed description of this architecture and different options.

The steps to connect one peripheral block to the other:

Step 1. Find the trigger group number in the Trigger Group Inputs section of the device configuration header file that corresponds to the output of the source peripheral block. For example, TRIG_IN_MUX_0_TCPWM0_TR_OVERFLOW0 (see group_trigmux_in_enums) TrigMux input belongs to Trigger Group 0. It is the same TCPWM0 counter 0 overflow output (as in the example for PERI_ver1).

Step 2. Find the same trigger group number in the Trigger Group Outputs section of the device configuration header file that corresponds to the trigger group number found in Step 1. Select the TrigMux output that can be connected to the destination peripheral block. For example, TRIG_OUT_MUX_0_PDMA0_TR_IN0 (see group_trigmux_out_enums) means that the trigger multiplexer Output 0 of Trigger Group 0 can be connected to the DW0 channel 0 trigger input (the same DMA channel as mentioned in the example for PERI_ver1).

Step 3. Call Cy_TrigMux_Connect() API once:

#if (CY_IP_MXPERI_VERSION >= 2U)
(void)Cy_TrigMux_Connect(TRIG_IN_MUX_0_TCPWM0_TR_OVERFLOW0, TRIG_OUT_MUX_0_PDMA0_TR_IN0, false, TRIGGER_TYPE_EDGE);
#endif /* CY_IP_MXPERI_VERSION */
/* 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_en_trigmux_status_t Cy_TrigMux_Connect(uint32_t inTrig, uint32_t outTrig, bool invert, en_trig_type_t trigType)
Connects an input trigger source and output trigger.
Definition: cy_trigmux.c:75

More Information

For more information on the TrigMux peripheral, refer to the technical reference manual (TRM).

API Reference

 Macros
 
 Functions
 
 Enumerated Types