HID Add-on API 1.0.99
Loading...
Searching...
No Matches
motion_sensor.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef _MOTION_SENSOR_H_
8#define _MOTION_SENSOR_H_
9
22
23#if CONFIG_DESKTOP_MOTION_SENSOR_PMW3360_ENABLE
24
25 #include <sensor/pmw3360.h>
26
27 #define MOTION_SENSOR_COMPATIBLE pixart_pmw3360
28
29 static const int motion_sensor_option_attr[MOTION_SENSOR_OPTION_COUNT] = {
30 [MOTION_SENSOR_OPTION_CPI] = PMW3360_ATTR_CPI,
31 [MOTION_SENSOR_OPTION_SLEEP_ENABLE] = PMW3360_ATTR_REST_ENABLE,
32 [MOTION_SENSOR_OPTION_SLEEP1_TIMEOUT] = PMW3360_ATTR_RUN_DOWNSHIFT_TIME,
33 [MOTION_SENSOR_OPTION_SLEEP2_TIMEOUT] = PMW3360_ATTR_REST1_DOWNSHIFT_TIME,
34 [MOTION_SENSOR_OPTION_SLEEP3_TIMEOUT] = PMW3360_ATTR_REST2_DOWNSHIFT_TIME,
35 [MOTION_SENSOR_OPTION_SLEEP1_SAMPLE_TIME] = PMW3360_ATTR_REST1_SAMPLE_TIME,
36 [MOTION_SENSOR_OPTION_SLEEP2_SAMPLE_TIME] = PMW3360_ATTR_REST2_SAMPLE_TIME,
37 [MOTION_SENSOR_OPTION_SLEEP3_SAMPLE_TIME] = PMW3360_ATTR_REST3_SAMPLE_TIME,
38 };
39
40#elif CONFIG_DESKTOP_MOTION_SENSOR_PAW3212_ENABLE
41
42 #include <sensor/paw3212.h>
43
44 #define MOTION_SENSOR_COMPATIBLE pixart_paw3212
45
46 static const int motion_sensor_option_attr[MOTION_SENSOR_OPTION_COUNT] = {
47 [MOTION_SENSOR_OPTION_CPI] = PAW3212_ATTR_CPI,
48 [MOTION_SENSOR_OPTION_SLEEP_ENABLE] = PAW3212_ATTR_SLEEP_ENABLE,
49 [MOTION_SENSOR_OPTION_SLEEP1_TIMEOUT] = PAW3212_ATTR_SLEEP1_TIMEOUT,
50 [MOTION_SENSOR_OPTION_SLEEP2_TIMEOUT] = PAW3212_ATTR_SLEEP2_TIMEOUT,
51 [MOTION_SENSOR_OPTION_SLEEP3_TIMEOUT] = PAW3212_ATTR_SLEEP3_TIMEOUT,
52 [MOTION_SENSOR_OPTION_SLEEP1_SAMPLE_TIME] = PAW3212_ATTR_SLEEP1_SAMPLE_TIME,
53 [MOTION_SENSOR_OPTION_SLEEP2_SAMPLE_TIME] = PAW3212_ATTR_SLEEP2_SAMPLE_TIME,
54 [MOTION_SENSOR_OPTION_SLEEP3_SAMPLE_TIME] = PAW3212_ATTR_SLEEP3_SAMPLE_TIME,
55 };
56
57#else
58
59 #error "Sensor not supported"
60
61#endif
62
63#endif /* _MOTION_SENSOR_H_ */
motion_sensor_option
Definition motion_sensor.h:10
@ MOTION_SENSOR_OPTION_SLEEP3_TIMEOUT
Definition motion_sensor.h:15
@ MOTION_SENSOR_OPTION_COUNT
Definition motion_sensor.h:20
@ MOTION_SENSOR_OPTION_SLEEP1_SAMPLE_TIME
Definition motion_sensor.h:16
@ MOTION_SENSOR_OPTION_SLEEP_ENABLE
Definition motion_sensor.h:12
@ MOTION_SENSOR_OPTION_SLEEP2_TIMEOUT
Definition motion_sensor.h:14
@ MOTION_SENSOR_OPTION_CPI
Definition motion_sensor.h:11
@ MOTION_SENSOR_OPTION_SLEEP3_SAMPLE_TIME
Definition motion_sensor.h:18
@ MOTION_SENSOR_OPTION_SLEEP1_TIMEOUT
Definition motion_sensor.h:13
@ MOTION_SENSOR_OPTION_SLEEP2_SAMPLE_TIME
Definition motion_sensor.h:17