1 /* 2 * Copyright (c) 2016 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_TMAG5273_H_ 8 #define ZEPHYR_INCLUDE_DRIVERS_SENSOR_TMAG5273_H_ 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 #include <zephyr/drivers/sensor.h> 15 16 /* --- Additional TMAG5273 definitions */ 17 18 /** Additional channels supported by the TMAG5273 */ 19 enum tmag5273_sensor_channel { 20 /** 21 * Magnitude measurement result between two axis in Gs. 22 */ 23 TMAG5273_CHAN_MAGNITUDE = SENSOR_CHAN_PRIV_START, 24 25 /** 26 * Magnitude measurement MSB as returned by the sensor. 27 */ 28 TMAG5273_CHAN_MAGNITUDE_MSB, 29 30 /** 31 * Angle result in deg, magnitude result in Gs and magnitude MSB between two axis. 32 */ 33 TMAG5273_CHAN_ANGLE_MAGNITUDE, 34 }; 35 36 /** Additional attributes supported by the TMAG5273 */ 37 enum tmag5273_attribute { 38 /** 39 * Define axis relation measurements. 40 * Supported values are: 41 * - \c TMAG5273_DT_ANGLE_MAG_NONE (0) 42 * - \c TMAG5273_DT_ANGLE_MAG_XY (1) 43 * - \c TMAG5273_DT_ANGLE_MAG_YZ (2) 44 * - \c TMAG5273_DT_ANGLE_MAG_XZ (3) 45 * 46 * Only available if calculation source can be changed during runtime. 47 */ 48 TMAG5273_ATTR_ANGLE_MAG_AXIS = SENSOR_ATTR_PRIV_START, 49 }; 50 51 /** 52 * Supported values 53 */ 54 55 #define TMAG5273_ANGLE_CALC_NONE 0 56 #define TMAG5273_ANGLE_CALC_XY 1 57 #define TMAG5273_ANGLE_CALC_YZ 2 58 #define TMAG5273_ANGLE_CALC_XZ 3 59 60 #ifdef __cplusplus 61 } 62 #endif 63 64 #endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_TMAG5273_H_ */ 65