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 */
17 acc_detector_distance_config_t *i2c_distance_detector_get_config(void);
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 */
34 uint32_t i2c_distance_detector_get_status(void);
35
36
37 /**
38 * @brief Get distance detector result
39 *
40 * @return result from distance detector
41 */
42 uint32_t i2c_distance_detector_get_result(void);
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 */
52 uint32_t i2c_distance_detector_get_counter(void);
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 */
78 void i2c_distance_detector_measure_on_wakeup(bool enable);
79
80
81 /**
82 * @brief Get measure on wake up state
83 *
84 * @return true if measure on wake up is enabled
85 */
86 bool i2c_distance_detector_get_measure_on_wakeup(void);
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:280
i2c_distance_detector_get_status
uint32_t i2c_distance_detector_get_status(void)
Get distance detector status.
Definition: i2c_distance_detector.c:188
i2c_distance_detector_get_result
uint32_t i2c_distance_detector_get_result(void)
Get distance detector result.
Definition: i2c_distance_detector.c:200
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:246
i2c_distance_detector_get_counter
uint32_t i2c_distance_detector_get_counter(void)
Get distance detector measure counter.
Definition: i2c_distance_detector.c:234
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:161
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:270
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:166
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:258
acc_detector_distance_config_t
struct acc_detector_distance_config acc_detector_distance_config_t
Distance Detector configuration.
Definition: acc_detector_distance.h:43