Line data Source code
1 1 : /*
2 : * Copyright (c) 2025 Paul Timke <ptimkec@live.com>
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : /**
8 : * @file
9 : * @brief Header file for extended sensor API of PAJ7620 sensor
10 : * @ingroup paj7620_interface
11 : */
12 :
13 : #ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_PAJ7620_H_
14 : #define ZEPHYR_INCLUDE_DRIVERS_SENSOR_PAJ7620_H_
15 :
16 : /**
17 : * @brief Pixart PAJ7620 gesture sensor
18 : * @defgroup paj7620_interface PAJ7620
19 : * @ingroup sensor_interface_ext
20 : * @{
21 : */
22 :
23 : #ifdef __cplusplus
24 : extern "C"
25 : {
26 : #endif /* __cplusplus */
27 :
28 : #include <zephyr/drivers/sensor.h>
29 :
30 : /**
31 : * @name Gesture flags
32 : * @{
33 : */
34 1 : #define PAJ7620_FLAG_GES_UP BIT(0) /**< "Up" gesture */
35 1 : #define PAJ7620_FLAG_GES_DOWN BIT(1) /**< "Down" gesture */
36 1 : #define PAJ7620_FLAG_GES_LEFT BIT(2) /**< "Left" gesture */
37 1 : #define PAJ7620_FLAG_GES_RIGHT BIT(3) /**< "Right" gesture */
38 1 : #define PAJ7620_FLAG_GES_FORWARD BIT(4) /**< "Forward" gesture */
39 1 : #define PAJ7620_FLAG_GES_BACKWARD BIT(5) /**< "Backward" gesture */
40 1 : #define PAJ7620_FLAG_GES_CLOCKWISE BIT(6) /**< "Clockwise" gesture */
41 1 : #define PAJ7620_FLAG_GES_COUNTERCLOCKWISE BIT(7) /**< "Counterclockwise" gesture */
42 1 : #define PAJ7620_FLAG_GES_WAVE BIT(8) /**< "Wave" gesture */
43 : /** @} */
44 :
45 : /**
46 : * @brief Custom sensor channels for PAJ7620
47 : */
48 1 : enum sensor_channel_paj7620 {
49 : /**
50 : * Gesture data (bit mask).
51 : *
52 : * This channel will contain gesture data as a bitmask where each
53 : * set bit represents a detected gesture. The possible gestures
54 : * that can be detected along with their corresponding bit are given
55 : * by the PAJ7620_FLAG_GES_X macros
56 : */
57 : SENSOR_CHAN_PAJ7620_GESTURES = SENSOR_CHAN_PRIV_START
58 : };
59 :
60 : #ifdef __cplusplus
61 : }
62 : #endif /* __cplusplus */
63 :
64 : /**
65 : * @}
66 : */
67 :
68 : #endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_PAJ7620_H_ */
|