1 /****************************************************************************
 2 
 3   Header file for Ultrasonic Service
 4   based on the Gen 2 Events and Services Framework
 5 
 6  ****************************************************************************/
 7 
 8 #ifndef UltrasonicService_H
 9 #define UltrasonicService_H
10 
11 #include <stdint.h>
12 #include <stdbool.h>
13 
14 #include "ES_Events.h"
15 #include "ES_Port.h"                // needed for definition of REENTRANT
16 // Public Function Prototypes
17 
18 bool InitUltrasonicService(uint8_t Priority);
19 bool PostUltrasonicService(ES_Event_t ThisEvent);
20 ES_Event_t RunUltrasonicService(ES_Event_t ThisEvent);
21 
22 typedef union {
23     uint32_t all;
24 
25     struct {
26         uint16_t buf;
27         uint16_t rollover;
28     } components;
29 } counter;
30 
31 extern volatile counter FrontCounter;
32 extern volatile counter RearCounter;
33 
34 void SetHasSentFrontNearEvent(bool val);
35 void SetHasSentFrontFarEvent(bool val);
36 void SetHasSentRearNearEvent(bool val);
37 void SetHasSentRearFarEvent(bool val);
38 
39 #endif /* ServTemplate_H */
40