iLLD_TC27xD
1.0
|
This SENT interface driver provides functions to communicate with external sensors.
Include following header file into your C code:
Declare SENT module and channel handles as global variables in your C code. If multiple SENT channels should be serviced, it makes sense to declare the SENT channel handle as an array:
See also How to define Interrupts?
Define priorities for the Interrrupt handler. This is normally done in the Ifx_IntPrioDef.h file:
Add the interrupt service routine to your C code. It has to call the SENT interrupt handler by passing the SENT channel handle:
Note: the SentInterruptHandler function is not part of the interface driver, but has to be implemented in the application. A template can be found below under Interrupt Service Handler
Finally install the interrupt handlers in your initialisation function:
The module initialisation can be done in the same function. Here an example for SENT and SPC mode:
After the module has been initialized, one or more SENT channels can be configured.
Here an example for three SENT channels in SENT and SPC mode:
The ISR has to be implemented in the application. Following template can be used to react on the events:
Following code snippet shows, how incoming data of a TLE4998S device can be decoded: