Line data Source code
1 1 : /*
2 : * Copyright (c) 2025 Croxel Inc.
3 : * Copyright (c) 2025 CogniPilot Foundation
4 : *
5 : * SPDX-License-Identifier: Apache-2.0
6 : */
7 :
8 : /**
9 : * @file
10 : * @brief Header file for extended sensor API of PAT9136 sensor
11 : * @ingroup pat9136_interface
12 : */
13 :
14 : #ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_PAT9136_H_
15 : #define ZEPHYR_INCLUDE_DRIVERS_SENSOR_PAT9136_H_
16 :
17 : /**
18 : * @brief Pixart PAT9136 optical flow sensor
19 : * @defgroup pat9136_interface PAT9136
20 : * @ingroup sensor_interface_ext
21 : * @{
22 : */
23 :
24 : #include <zephyr/drivers/sensor.h>
25 :
26 : #ifdef __cplusplus
27 : extern "C" {
28 : #endif
29 :
30 : /**
31 : * Custom sensor channels for PAT9136
32 : *
33 : * This sensor does have the ability to provide DXY in meaningful units, and
34 : * since the standard channels' unit is in points (SENSOR_CHAN_POS_DX,
35 : * SENSOR_CHAN_POS_DY, SENSOR_CHAN_POS_DXYZ), we've captured the following
36 : * channels to provide an alternative for this sensor.
37 : */
38 1 : enum sensor_channel_pat9136 {
39 : /** Position change on the X axis, in millimeters. */
40 : SENSOR_CHAN_POS_DX_MM = SENSOR_CHAN_PRIV_START + 1,
41 : /** Position change on the Y axis, in millimeters. */
42 : SENSOR_CHAN_POS_DY_MM,
43 : /** Position change on the X, Y and Z axis, in millimeters.
44 : * Added additional offset so the channels X and Y can be accessed
45 : * relative to XYZ in spite of not supporting DZ.
46 : */
47 : SENSOR_CHAN_POS_DXYZ_MM = SENSOR_CHAN_POS_DY_MM + 2,
48 : };
49 :
50 : #ifdef __cplusplus
51 : }
52 : #endif
53 :
54 : /**
55 : * @}
56 : */
57 :
58 : #endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_PAT9136_H_ */
|