1 /*
2  * Copyright (c) 2020 Vestas Wind Systems A/S
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @file
9  * @brief Extended public API for the NXP MCUX Analog Comparator (ACMP)
10  */
11 
12 #ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_MCUX_ACMP_H_
13 #define ZEPHYR_INCLUDE_DRIVERS_SENSOR_MCUX_ACMP_H_
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include <drivers/sensor.h>
20 
21 enum sensor_channel_mcux_acmp {
22 	/** Analog Comparator Output. */
23 	SENSOR_CHAN_MCUX_ACMP_OUTPUT = SENSOR_CHAN_PRIV_START,
24 };
25 
26 enum sensor_trigger_type_mcux_acmp {
27 	/** Analog Comparator Output rising event trigger. */
28 	SENSOR_TRIG_MCUX_ACMP_OUTPUT_RISING = SENSOR_TRIG_PRIV_START,
29 	/** Analog Comparator Output falling event trigger. */
30 	SENSOR_TRIG_MCUX_ACMP_OUTPUT_FALLING,
31 };
32 
33 enum sensor_attribute_mcux_acmp {
34 	/** Analog Comparator hard block offset. */
35 	SENSOR_ATTR_MCUX_ACMP_OFFSET_LEVEL = SENSOR_ATTR_COMMON_COUNT,
36 	/** Analog Comparator hysteresis level. */
37 	SENSOR_ATTR_MCUX_ACMP_HYSTERESIS_LEVEL,
38 	/**
39 	 * Analog Comparator Digital-to-Analog Converter voltage
40 	 * reference source.
41 	 */
42 	SENSOR_ATTR_MCUX_ACMP_DAC_VOLTAGE_REFERENCE,
43 	/** Analog Comparator Digital-to-Analog Converter value. */
44 	SENSOR_ATTR_MCUX_ACMP_DAC_VALUE,
45 	/** Analog Comparator positive port input. */
46 	SENSOR_ATTR_MCUX_ACMP_POSITIVE_PORT_INPUT,
47 	/** Analog Comparator positive mux input. */
48 	SENSOR_ATTR_MCUX_ACMP_POSITIVE_MUX_INPUT,
49 	/** Analog Comparator negative port input. */
50 	SENSOR_ATTR_MCUX_ACMP_NEGATIVE_PORT_INPUT,
51 	/** Analog Comparator negative mux input. */
52 	SENSOR_ATTR_MCUX_ACMP_NEGATIVE_MUX_INPUT,
53 };
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_MCUX_ACMP_H_ */
60