PSoC 4 Peripheral Driver Library - Alpha
TrigMux (Trigger Multiplexer) - Not supported in Alpha release

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 (ModusToolbox only) 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 are either reduction multiplexers or distribution multiplexers. The figure below illustrates a generic trigger multiplexer block implementation with a reduction multiplexer layer of N trigger groups and a distribution multiplexer layer of M trigger groups. The reduction multiplexer groups have input options that are the trigger outputs coming from the different peripheral blocks and the reduction multiplexer groups route them to intermediate signals. The distribution multiplexer groups have input options from these intermediate signals and route them back to multiple peripheral blocks as their trigger inputs.

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 to another, the user must configure a reduction multiplexer and a distribution multiplexer. The Cy_TrigMux_Connect is used to configure a trigger multiplexer connection. The user will need two calls of this API, one for the reduction multiplexer and another for the distribution multiplexer, to achieve the trigger connection from a source peripheral to a destination peripheral.

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.

The constants for TrigMux in the device configuration header file are divided into four types based on the signal being input/output and being part of a reduction/distribution trigger multiplexer.

The four types of the input/output parameters are: 1) The parameters for the reduction multiplexer's inputs (input signals of TrigMux); 2) The parameters for the reduction multiplexer's outputs (intermediate signals); 3) The parameters for the distribution multiplexer's inputs (intermediate signals); 4) The parameters for the distribution multiplexer's outputs (output signals of TrigMux).

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 first peripheral block. For example, TRIG11_IN_TCPWM0_TR_OVERFLOW0 input of the reduction multiplexers belongs to Trigger Group 11.

Step 2. Find the trigger group number in the Trigger Group Outputs section of the device configuration header file that corresponds to the input of the second peripheral block. For example, TRIG0_OUT_CPUSS_DW0_TR_IN0 output of the distribution multiplexer belongs to Trigger Group 0.

Step 3. Find the same trigger group number in the Trigger Group Inputs section of the device configuration header file that corresponds to the trigger group number found in Step 1. Select the reduction multiplexer output that can be connected to the trigger group found in Step 2. For example, TRIG0_IN_TR_GROUP11_OUTPUT0 means that Reduction Multiplexer For example, TRIG0_IN_TR_GROUP11_OUTPUT0 means that Reduction Multiplexer Output 15 of Trigger Group 13 can be connected to Trigger Group 0.

Step 4. 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 2. Select the distribution multiplexer input that can be connected to the trigger group found in Step 1. For example, TRIG11_OUT_TR_GROUP0_INPUT9 means that the Distribution Multiplexer Input 42 of Trigger Group 0 can be connected to the output of the reduction multiplexer in Trigger Group 13 found in Step 3.

Step 5. Call Cy_TrigMux_Connect() API twice: the first call - with the constants for the inTrig and outTrig parameters found in Steps 1 and Step 4, the second call - with the constants for the inTrig and outTrig parameters found in Steps 2 and Step 3. For example, Cy_TrigMux_Connect(TRIG11_IN_TCPWM0_TR_OVERFLOW0, TRIG11_OUT_TR_GROUP0_INPUT9, false, TRIGGER_TYPE_LEVEL); Cy_TrigMux_Connect(TRIG0_IN_TR_GROUP11_OUTPUT0, TRIG0_OUT_CPUSS_DW0_TR_IN0, false, TRIGGER_TYPE_EDGE);

More Information

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

Changelog

VersionChangesReason for Change
1.0 Initial version

API Reference

 Macros
 
 Functions
 
 Enumerated Types