Line data Source code
1 1 : /*
2 : * Copyright (c) 2024 Florian Weber <Florian.Weber@live.de>
3 : * SPDX-License-Identifier: Apache-2.0
4 : */
5 :
6 : /**
7 : * @file
8 : * @brief Header file for extended sensor API of MLX90394 sensor
9 : * @ingroup mlx90394_interface
10 : */
11 :
12 : #ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_MLX90394_H_
13 : #define ZEPHYR_INCLUDE_DRIVERS_SENSOR_MLX90394_H_
14 :
15 : /**
16 : * @brief Melexis MLX90394 magnetometer
17 : * @defgroup mlx90394_interface MLX90394
18 : * @ingroup sensor_interface_ext
19 : * @{
20 : */
21 :
22 : #ifdef __cplusplus
23 : extern "C" {
24 : #endif
25 :
26 : #include <zephyr/drivers/sensor.h>
27 :
28 : /**
29 : * @brief Custom sensor attributes for MLX90394
30 : */
31 1 : enum mlx90394_sensor_attribute {
32 : /**
33 : * Low noise mode. (SENSOR_CHAN_MAGN_XYZ channel only)
34 : */
35 : MLX90394_SENSOR_ATTR_MAGN_LOW_NOISE = SENSOR_ATTR_PRIV_START,
36 : /**
37 : * Digital filter setting for X and Y axes
38 : *
39 : * Controls the number of filter taps applied to the X and Y axes for noise reduction.
40 : * Higher values provide better noise performance at cost of measurement time.
41 : *
42 : * - sensor_value.val1: Filter setting (0-7)
43 : */
44 : MLX90394_SENSOR_ATTR_MAGN_FILTER_XY,
45 : /**
46 : * Digital filter configuration for Z axis
47 : *
48 : * Similar to XY filter but configured independently since Z axis typically has different
49 : * noise characteristics.
50 : *
51 : * - sensor_value.val1: Filter setting (0-7)
52 : */
53 : MLX90394_SENSOR_ATTR_MAGN_FILTER_Z,
54 : /**
55 : * Over-sampling ratio for magnetic measurements.
56 : *
57 : * - sensor_value.val1 == 0: Normal sampling rate.
58 : * - sensor_value.val1 == 1: Double sampling rate.
59 : */
60 : MLX90394_SENSOR_ATTR_MAGN_OSR,
61 : /**
62 : * Digital filter configuration for temperature measurements
63 : *
64 : * Higher settings provide better temperature measurement stability.
65 : *
66 : * - sensor_value.val1: Filter setting (0-7)
67 : */
68 : MLX90394_SENSOR_ATTR_TEMP_FILTER,
69 : /**
70 : * Over-sampling ratio for temperature measurements.
71 : *
72 : * - sensor_value.val1 == 0: Normal sampling rate.
73 : * - sensor_value.val1 == 1: Double sampling rate.
74 : */
75 : MLX90394_SENSOR_ATTR_TEMP_OSR
76 : };
77 :
78 : #ifdef __cplusplus
79 : }
80 : #endif
81 :
82 : /**
83 : * @}
84 : */
85 :
86 : #endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_MLX90394_H_ */
|