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
Name | Description |
---|---|
PTG_Initialize | Initializes PTG module |
PTG_Deinitialize | Deinitializes the PTG peripheral of the device |
PTG_Enable | Enables the PTG peripheral of the device |
PTG_Disable | Disables the PTG peripheral of the device |
PTG_StepSequenceStart | Starts the step sequence of the PTG peripheral of the device |
PTG_StepSequenceStop | Stops the step sequence of the PTG peripheral of the device |
PTG_SoftwareTriggerSet | Activates the software trigger of the PTG peripheral of the device |
PTG_SoftwareTriggerClear | Clears the software trigger of the PTG peripheral of the device |
PTG_WatchdogTimeoutStatusGet | Indicates the status of the watchdog timeout status of the PTG Peripheral of the device |
PTG_EventCallbackRegister | Registers a callback function for PTG Peripheral events |
Data types and constants
Name | Type | Description |
---|---|---|
PTG_EVENTS | Enum | Defines the PTG events that are available |
PTG_EVENTS_CALLBACK | Typedef | Defines the function pointer data type and function signature for the QEI peripheral callback function |
PTG_EVENTS_CALLBACK_OBJECT | Struct | Defines the data type for PTG peripheral callback object |