File tree Expand file tree Collapse file tree 4 files changed +33
-2
lines changed
include/zephyr/drivers/sensor Expand file tree Collapse file tree 4 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -135,4 +135,20 @@ config APDS9960_PPULSE_COUNT
135135 range 1 64
136136 default 8
137137
138+ config APDS9960_ENABLE_GESTURE
139+ bool "Gesture Sense"
140+ default n
141+ help
142+ Enable Gesture Sense.
143+
144+ config APDS9960_GESTURE_PROXIMITY
145+ int "Gesture Proximity Enter Threshold"
146+ range 0 255
147+ default 40
148+
149+ config APDS9960_GESTURE_DIFFERENCE
150+ int "Minimum IR diode difference for gesture"
151+ range 0 255
152+ default 5
153+
138154endif # APDS9960
Original file line number Diff line number Diff line change 2222#include <string.h>
2323#include <zephyr/logging/log.h>
2424
25- #include " apds9960.h"
25+ #include <zephyr/drivers/sensor/ apds9960.h>
2626
2727LOG_MODULE_REGISTER (APDS9960 , CONFIG_SENSOR_LOG_LEVEL );
2828
Original file line number Diff line number Diff line change 1414
1515extern struct apds9960_data apds9960_driver ;
1616
17- #include <zephyr/logging/log .h>
17+ #include <zephyr/drivers/sensor/apds9960 .h>
1818LOG_MODULE_DECLARE (APDS9960 , CONFIG_SENSOR_LOG_LEVEL );
1919
2020void apds9960_work_cb (struct k_work * work )
Original file line number Diff line number Diff line change 99#define ZEPHYR_DRIVERS_SENSOR_APDS9960_APDS9960_H_
1010
1111#include <zephyr/drivers/gpio.h>
12+ #include <zephyr/drivers/i2c.h>
1213
1314#define APDS9960_ENABLE_REG 0x80
1415#define APDS9960_ENABLE_GEN BIT(6)
@@ -227,12 +228,26 @@ struct apds9960_config {
227228 uint8_t pled_boost ;
228229};
229230
231+ /* apds9960 specific channels */
232+ enum sensor_channel_apds9960 {
233+ SENSOR_CHAN_APDS9960_GESTURE = SENSOR_CHAN_PRIV_START ,
234+ };
235+
236+ enum apds9960_gesture {
237+ APDS9960_GESTURE_NONE ,
238+ APDS9960_GESTURE_UP ,
239+ APDS9960_GESTURE_DOWN ,
240+ APDS9960_GESTURE_LEFT ,
241+ APDS9960_GESTURE_RIGHT ,
242+ };
243+
230244struct apds9960_data {
231245 struct gpio_callback gpio_cb ;
232246 struct k_work work ;
233247 const struct device * dev ;
234248 uint16_t sample_crgb [4 ];
235249 uint8_t pdata ;
250+ enum apds9960_gesture gesture ;
236251
237252#ifdef CONFIG_APDS9960_TRIGGER
238253 sensor_trigger_handler_t p_th_handler ;
You can’t perform that action at this time.
0 commit comments