i2c_presence_detector.h
Go to the documentation of this file.
1 // Copyright (c) Acconeer AB, 2023
2 // All rights reserved
3
4 #ifndef I2C_PRESENCE_DETECTOR_H_
5 #define I2C_PRESENCE_DETECTOR_H_
6
7 #include <stdbool.h>
8 #include <stdint.h>
9
10 #include "acc_detector_presence.h"
11
12
13 /**
14 * @brief Get presence detector configuration handle
15 *
16 * @return presence detector configuration handle
17 */
18 acc_detector_presence_config_t *i2c_presence_detector_get_config(void);
19
20
21 /**
22 * @brief Send command to be executed to i2c presence detector
23 *
24 * @param[in] command The command to be executed
25 * @return true if successful
26 */
27 bool i2c_presence_detector_command(uint32_t command);
28
29
30 /**
31 * @brief Get presence detector status
32 *
33 * @return status from presence detector
34 */
35 uint32_t i2c_presence_detector_get_status(void);
36
37
38 /**
39 * @brief Get presence detector result
40 *
41 * @return result from presence detector
42 */
43 uint32_t i2c_presence_detector_get_result(void);
44
45
46 /**
47 * @brief Get presence detector distance
48 *
49 * @return The distance of the detected presence
50 */
51 float i2c_presence_detector_get_distance(void);
52
53
54 /**
55 * @brief Get intra presence score
56 *
57 * @return A measure of the amount of fast motion detected.
58 */
59 float i2c_presence_detector_get_intra_presence_score(void);
60
61
62 /**
63 * @brief Get inter presence score
64 *
65 * @return A measure of the amount of slow motion detected.
66 */
67 float i2c_presence_detector_get_inter_presence_score(void);
68
69
70 /**
71 * @brief Get presence detector measure counter
72 *
73 * The counter will be increased every time the presence detector completes a measure
74 *
75 * @return measure counter from presence detector
76 */
77 uint32_t i2c_presence_detector_get_counter(void);
78
79
80 /**
81 * @brief Enable/Disable gpio output for presence detected
82 *
83 * @param[in] enable Enable gpio output for presence detected if set to true
84 */
85 void i2c_presence_detector_presence_detected_gpio(bool enable);
86
87
88 /**
89 * @brief Get gpio output for presence detected state
90 *
91 * @return true if gpio output for presence detected is enabled
92 */
93 bool i2c_presence_detector_get_presence_detected_gpio(void);
94
95
96 #endif
i2c_presence_detector_get_status
uint32_t i2c_presence_detector_get_status(void)
Get presence detector status.
Definition: i2c_presence_detector.c:230
i2c_presence_detector_get_counter
uint32_t i2c_presence_detector_get_counter(void)
Get presence detector measure counter.
Definition: i2c_presence_detector.c:318
i2c_presence_detector_get_config
acc_detector_presence_config_t * i2c_presence_detector_get_config(void)
Get presence detector configuration handle.
Definition: i2c_presence_detector.c:201
i2c_presence_detector_presence_detected_gpio
void i2c_presence_detector_presence_detected_gpio(bool enable)
Enable/Disable gpio output for presence detected.
Definition: i2c_presence_detector.c:331
i2c_presence_detector_get_distance
float i2c_presence_detector_get_distance(void)
Get presence detector distance.
Definition: i2c_presence_detector.c:279
i2c_presence_detector_get_result
uint32_t i2c_presence_detector_get_result(void)
Get presence detector result.
Definition: i2c_presence_detector.c:243
acc_detector_presence_config_t
struct acc_detector_presence_config acc_detector_presence_config_t
Definition: acc_detector_presence.h:44
i2c_presence_detector_get_inter_presence_score
float i2c_presence_detector_get_inter_presence_score(void)
Get inter presence score.
Definition: i2c_presence_detector.c:305
i2c_presence_detector_get_presence_detected_gpio
bool i2c_presence_detector_get_presence_detected_gpio(void)
Get gpio output for presence detected state.
Definition: i2c_presence_detector.c:342
i2c_presence_detector_get_intra_presence_score
float i2c_presence_detector_get_intra_presence_score(void)
Get intra presence score.
Definition: i2c_presence_detector.c:292
acc_detector_presence.h
i2c_presence_detector_command
bool i2c_presence_detector_command(uint32_t command)
Send command to be executed to i2c presence detector.
Definition: i2c_presence_detector.c:207