Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_hc_sr04.h
1 #ifndef _BC_HC_SR04_H
2 #define _BC_HC_SR04_H
3 
4 #include <bc_tick.h>
5 
9 
10 typedef enum
11 {
14 
17 
19 
20 void bc_hc_sr04_init(void);
21 
25 
26 void bc_hc_sr04_set_event_handler(void (*event_handler)(bc_hc_sr04_event_t, void *), void *event_param);
27 
30 
32 
36 
37 bool bc_hc_sr04_measure(void);
38 
43 
44 bool bc_hc_sr04_get_distance_millimeter(float *millimeter);
45 
47 
48 #endif // _BC_HC_SR04_H
uint64_t bc_tick_t
Timestamp data type.
Definition: bc_tick.h:16
bool bc_hc_sr04_measure(void)
Start measurement manually.
Definition: bc_hc_sr04.c:93
bool bc_hc_sr04_get_distance_millimeter(float *millimeter)
Get measured distance in millimeters.
Definition: bc_hc_sr04.c:143
bc_hc_sr04_event_t
Definition: bc_hc_sr04.h:10
Update event.
Definition: bc_hc_sr04.h:16
void bc_hc_sr04_set_event_handler(void(*event_handler)(bc_hc_sr04_event_t, void *), void *event_param)
Set callback function.
Definition: bc_hc_sr04.c:71
Error event.
Definition: bc_hc_sr04.h:13
void bc_hc_sr04_set_update_interval(bc_tick_t interval)
Set measurement interval.
Definition: bc_hc_sr04.c:77