![]() |
The eTPU INJ APIs etpu_inj.c/.h includes API functions for eTPU function Direct Injection.
Each instance of the INJ eTPU function controls a single INJ channel together with up to 3 BANK channels. The BANK channels can be common for more INJ instances.
This eTPU function enables to generate complex angle- and time-based output patterns, primarily dedicated to direct injection timing control. The INJ channel can control the outputs of up to 3 additional channels, called BANK channels (e.g. Boost, Batt, ...).
An injection sequence consists of injections. Each injection starts at a defined angle (angle_start) and consists of phases. Each phase is defined by output states of the INJ and all the BANK channels, a phase duration, and options to generate DMA requests at the beginning of the phase. The number of injections and the number of phases in each injection is configurable. More INJ channels (individual injectors) may use separate injection sequences, or can share the same sequence.
There is an INJ parameter tdc_angle, relative to which all angles are defined. Positive angles precede the tdc_angle, negative angles come after. INJ parameter angle_irq which defines a tdc_angle-relative angle at which an IRQ request is generated. The CPU may reconfigure the injection sequence setting on this interrupt, but not later then the first injection angle_start is reached. If the CPU does not reconfigure, the actual injection sequence definition is used. INJ parameter angle_stop defines the latest tdc_angle-relative angle when the whole injection sequence must be finished. If it is not, all INJ and BANK outputs are turned to inactive state, whatever injection phase is active.
The CPU can monitor the INJ operation using INJ state variables injection_counter, phase_counter and error. The reported error flags are: INJ_ERROR_PREV_INJ_NOT_FINISHED - injection sequence can not start while another INJ channel occupies the BANK channels. The injection sequence is not generated. The global parameter INJ_active_bank_chans keeps track of which BANK channels are in use. INJ_ERROR_LATE_START_ANGLE_1ST - the 1st injection start-angle was about to be scheduled in past, hence the whole injection sequence was skipped. INJ_ERROR_LATE_START_ANGLE_NTH - the 2nd or later injection start-angle was about to be scheduled in past, hence the rest of the injection sequence was skipped. INJ_ERROR_STOPPED_BY_STOP_ANGLE - the injection sequence was not finished before the stop-angle and hence the injection was hard-stopped at the stop-angle.
Generated by ![]() |
© Freescale Semiconductor Inc. 2004 - 2012. All Rights Reserved. |