eTPU-CAM-API Documentation
The eTPU CAM APIs etpu_cam.c/.h includes API functions for eTPU function CAM, typically used together with CRANK in an engine position system.
The CAM eTPU function uses 1 eTPU channel to log input signal transitions. More instances of CAM can be initialized to independently log several inputs.
Features:
- Based on the selected mode, either raising, falling or both signal transitions are detected and logged.
- The log buffer size is configurable.
- The log can be reset automatically by a link from Crank eTPU function or manually by the CPU application. Reseting the log means setting the buffer index to the buffer start position so that the next transition overwrites the first value in the buffer.
- Number of transitions logged during the last engine cycle (between last two log resets) and the actual position in the log buffer are available to read.
- 2 error conditions are reported:
- FS_ETPU_CAM_ERROR_ZERO_TRANS – no input transition was logged during the last engine cycle (between last two leg resets). It might mean the cam signal is lost.
- FS_ETPU_CAM_ERROR_LOG_OVERFLOW – the log buffer size is not big enought to log all input transitions. The last transition was not logged.
- Channel interrupt is generated when an error condition is detected.
A single item in the log buffer is a 32-bit word which includes:
- transition TCR2 angle in the lower 24 bits,
- transition polarity (0-falling, 1-rising) in upper 8 bits.