eTPU-TG-API Documentation
The eTPU TG APIs etpu_tg.c/.h includes API functions for eTPU function Tooth Generator, used to generate Crank & Cam patterns.
Each instance of the TG eTPU function controls two eTPU channels.
Features:
- Selectable polarity of the output signals.
- The crank tooth pattern is defined by
- number of teeth between two gaps (teeth_till_gap),
- number of missing teeth in one gap (teeth_in_gap) and
- number of teeth per one engine cycle (teeth_per_cycle).
- The crank tooth pattern including an additional tooth is not supported.
- The cam pattern is defined by the initial cam signal polarity and an array of cam transitions. The position of each transition is defined by the corresponding crank tooth number.
- The engine speed is defined by tooth_period_target and an exponential acceleration/deceleration speed profile given by accel_ratio.
- The crank signal generation can be disabled/enabled at any time.
- The TG operation can be monitored using TG state variables tooth_counter_cycle and tooth_period_actual.
- No channel interrupt is generated by TG.