i2c_distance_detector.h
Go to the documentation of this file.
1 // Copyright (c) Acconeer AB, 2023
2 // All rights reserved
3 
4 #ifndef I2C_DISTANCE_DETECTOR_H_
5 #define I2C_DISTANCE_DETECTOR_H_
6 
7 #include <stdbool.h>
8 #include <stdint.h>
9 
10 #include "acc_detector_distance.h"
11 
12 /**
13  * @brief Get distance detector configuration handle
14  *
15  * @return distance detector configuration handle
16  */
18 
19 
20 /**
21  * @brief Send command to be executed to i2c distance detector
22  *
23  * @param[in] command The command to be executed
24  * @return true if successful
25  */
26 bool i2c_distance_detector_command(uint32_t command);
27 
28 
29 /**
30  * @brief Get distance detector status
31  *
32  * @return status from distance detector
33  */
35 
36 
37 /**
38  * @brief Get distance detector result
39  *
40  * @return result from distance detector
41  */
43 
44 
45 /**
46  * @brief Get distance detector measure counter
47  *
48  * The counter will be increased every time the distance detector completes a measure
49  *
50  * @return measure counter from distance detector
51  */
53 
54 
55 /**
56  * @brief Get the peak distance for a specific peak id
57  *
58  * @param[in] peak_id The id of the peak
59  * @return The distance to the peak
60  */
61 float i2c_distance_detector_get_peak_distance(uint16_t peak_id);
62 
63 
64 /**
65  * @brief Get the peak strength for a specific peak id
66  *
67  * @param[in] peak_id The id of the peak
68  * @return The strength of the peak
69  */
70 float i2c_distance_detector_get_peak_strength(uint16_t peak_id);
71 
72 
73 /**
74  * @brief Enable/Disable measure on wake up
75  *
76  * @param[in] enable Enable measure on wake up if set to true
77  */
79 
80 
81 /**
82  * @brief Get measure on wake up state
83  *
84  * @return true if measure on wake up is enabled
85  */
87 
88 
89 #endif
i2c_distance_detector_get_measure_on_wakeup
bool i2c_distance_detector_get_measure_on_wakeup(void)
Get measure on wake up state.
Definition: i2c_distance_detector.c:301
i2c_distance_detector_get_status
uint32_t i2c_distance_detector_get_status(void)
Get distance detector status.
Definition: i2c_distance_detector.c:203
i2c_distance_detector_get_result
uint32_t i2c_distance_detector_get_result(void)
Get distance detector result.
Definition: i2c_distance_detector.c:216
i2c_distance_detector_get_peak_distance
float i2c_distance_detector_get_peak_distance(uint16_t peak_id)
Get the peak distance for a specific peak id.
Definition: i2c_distance_detector.c:264
i2c_distance_detector_get_counter
uint32_t i2c_distance_detector_get_counter(void)
Get distance detector measure counter.
Definition: i2c_distance_detector.c:251
i2c_distance_detector_get_config
acc_detector_distance_config_t * i2c_distance_detector_get_config(void)
Get distance detector configuration handle.
Definition: i2c_distance_detector.c:174
i2c_distance_detector_measure_on_wakeup
void i2c_distance_detector_measure_on_wakeup(bool enable)
Enable/Disable measure on wake up.
Definition: i2c_distance_detector.c:290
acc_detector_distance.h
i2c_distance_detector_command
bool i2c_distance_detector_command(uint32_t command)
Send command to be executed to i2c distance detector.
Definition: i2c_distance_detector.c:180
i2c_distance_detector_get_peak_strength
float i2c_distance_detector_get_peak_strength(uint16_t peak_id)
Get the peak strength for a specific peak id.
Definition: i2c_distance_detector.c:277
acc_detector_distance_config_t
struct acc_detector_distance_config acc_detector_distance_config_t
Definition: acc_detector_distance.h:43