3.2.16 Peripheral Trigger Generator (PTG)

The particular family device's Peripheral Trigger Generator (PTG) module is a user-programmable sequencer that is capable of generating complex trigger signal sequences to coordinate the operation of various peripherals. The PTG module is designed to interface with other modules, such as an Analog-to-Digital Converter (ADC), output compare and PWM modules, timers and interrupt controllers.

Using The Library

The PTG consists of the following key features and the peripheral library can be utilized to achieve the same:

• Behavior is Step Command Driven:

– Step commands are eight bits wide

• Commands are Stored in a Step Queue:

– Queue depth is up to 32 entries

– Programmable Step execution time (Step delay)

• Supports the Command Sequence Loop:

– Can be nested one-level deep

– Conditional or unconditional loop

– Two 16-bit loop counters

• Up to 16 Hardware Input Triggers:

– Sensitive to either positive or negative edges, or a high or low level

• One Software Input Trigger

• Generates up to 32 Unique Output Trigger Signals

• Generates Two Types of Trigger Outputs:

– Individual

– Broadcast

• Generates up to four unique interrupt signals

• Two 16-Bit General Purpose Timers

• Flexible Self-Contained Watchdog Timer (WDT) to Set an Upper Limit to Trigger Wait Time

• Configurable Clock from Dedicated Clock Generator module

• Programmable Clock Divider

Library Interface

Peripheral Trigger Generator peripheral library provides the following interfaces:

Functions

NameDescription
PTG_InitializeInitializes PTG module
PTG_DeinitializeDeinitializes the PTG peripheral of the device
PTG_EnableEnables the PTG peripheral of the device
PTG_DisableDisables the PTG peripheral of the device
PTG_StepSequenceStartStarts the step sequence of the PTG peripheral of the device
PTG_StepSequenceStopStops the step sequence of the PTG peripheral of the device
PTG_SoftwareTriggerSetActivates the software trigger of the PTG peripheral of the device
PTG_SoftwareTriggerClearClears the software trigger of the PTG peripheral of the device
PTG_WatchdogTimeoutStatusGetIndicates the status of the watchdog timeout status of the PTG Peripheral of the device
PTG_EventCallbackRegisterRegisters a callback function for PTG Peripheral events

Data types and constants

NameTypeDescription
PTG_EVENTSEnumDefines the PTG events that are available
PTG_EVENTS_CALLBACKTypedefDefines the function pointer data type and function signature for the QEI peripheral callback function
PTG_EVENTS_CALLBACK_OBJECTStructDefines the data type for PTG peripheral callback object