-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sensors: Add DTS bindings for sensor channels
Move the sensor channel enum to a dts includable headers. This means that the enum had to change to #define calls. In order to keep things backwards compatible, There's a shim header that undefines them and allows the enum to exist for now while we work on deprecating it. Signed-off-by: Yuval Peress <[email protected]>
- Loading branch information
Showing
4 changed files
with
430 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,260 @@ | ||
/* | ||
* Copyright (c) 2024 Google Inc | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#ifndef INCLUDE_ZEPHYR_DRIVERS_SENSOR_CHANNEL_SHIM_H_ | ||
#define INCLUDE_ZEPHYR_DRIVERS_SENSOR_CHANNEL_SHIM_H_ | ||
|
||
#ifdef SENSOR_CHAN_ACCEL_X | ||
#undef SENSOR_CHAN_ACCEL_X | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_ACCEL_Y | ||
#undef SENSOR_CHAN_ACCEL_Y | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_ACCEL_Z | ||
#undef SENSOR_CHAN_ACCEL_Z | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_ACCEL_XYZ | ||
#undef SENSOR_CHAN_ACCEL_XYZ | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GYRO_X | ||
#undef SENSOR_CHAN_GYRO_X | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GYRO_Y | ||
#undef SENSOR_CHAN_GYRO_Y | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GYRO_Z | ||
#undef SENSOR_CHAN_GYRO_Z | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GYRO_XYZ | ||
#undef SENSOR_CHAN_GYRO_XYZ | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_MAGN_X | ||
#undef SENSOR_CHAN_MAGN_X | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_MAGN_Y | ||
#undef SENSOR_CHAN_MAGN_Y | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_MAGN_Z | ||
#undef SENSOR_CHAN_MAGN_Z | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_MAGN_XYZ | ||
#undef SENSOR_CHAN_MAGN_XYZ | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_DIE_TEMP | ||
#undef SENSOR_CHAN_DIE_TEMP | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_AMBIENT_TEMP | ||
#undef SENSOR_CHAN_AMBIENT_TEMP | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_PRESS | ||
#undef SENSOR_CHAN_PRESS | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_PROX | ||
#undef SENSOR_CHAN_PROX | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_HUMIDITY | ||
#undef SENSOR_CHAN_HUMIDITY | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_LIGHT | ||
#undef SENSOR_CHAN_LIGHT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_IR | ||
#undef SENSOR_CHAN_IR | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_RED | ||
#undef SENSOR_CHAN_RED | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GREEN | ||
#undef SENSOR_CHAN_GREEN | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_BLUE | ||
#undef SENSOR_CHAN_BLUE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_ALTITUDE | ||
#undef SENSOR_CHAN_ALTITUDE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_PM_1_0 | ||
#undef SENSOR_CHAN_PM_1_0 | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_PM_2_5 | ||
#undef SENSOR_CHAN_PM_2_5 | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_PM_10 | ||
#undef SENSOR_CHAN_PM_10 | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_DISTANCE | ||
#undef SENSOR_CHAN_DISTANCE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_CO2 | ||
#undef SENSOR_CHAN_CO2 | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_O2 | ||
#undef SENSOR_CHAN_O2 | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_VOC | ||
#undef SENSOR_CHAN_VOC | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAS_RES | ||
#undef SENSOR_CHAN_GAS_RES | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_VOLTAGE | ||
#undef SENSOR_CHAN_VOLTAGE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_VSHUNT | ||
#undef SENSOR_CHAN_VSHUNT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_CURRENT | ||
#undef SENSOR_CHAN_CURRENT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_POWER | ||
#undef SENSOR_CHAN_POWER | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_RESISTANCE | ||
#undef SENSOR_CHAN_RESISTANCE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_ROTATION | ||
#undef SENSOR_CHAN_ROTATION | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_POS_DX | ||
#undef SENSOR_CHAN_POS_DX | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_POS_DY | ||
#undef SENSOR_CHAN_POS_DY | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_POS_DZ | ||
#undef SENSOR_CHAN_POS_DZ | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_RPM | ||
#undef SENSOR_CHAN_RPM | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_VOLTAGE | ||
#undef SENSOR_CHAN_GAUGE_VOLTAGE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_AVG_CURRENT | ||
#undef SENSOR_CHAN_GAUGE_AVG_CURRENT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_STDBY_CURRENT | ||
#undef SENSOR_CHAN_GAUGE_STDBY_CURRENT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_MAX_LOAD_CURRENT | ||
#undef SENSOR_CHAN_GAUGE_MAX_LOAD_CURRENT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_TEMP | ||
#undef SENSOR_CHAN_GAUGE_TEMP | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_STATE_OF_CHARGE | ||
#undef SENSOR_CHAN_GAUGE_STATE_OF_CHARGE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_FULL_CHARGE_CAPACITY | ||
#undef SENSOR_CHAN_GAUGE_FULL_CHARGE_CAPACITY | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_REMAINING_CHARGE_CAPACITY | ||
#undef SENSOR_CHAN_GAUGE_REMAINING_CHARGE_CAPACITY | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_NOM_AVAIL_CAPACITY | ||
#undef SENSOR_CHAN_GAUGE_NOM_AVAIL_CAPACITY | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_FULL_AVAIL_CAPACITY | ||
#undef SENSOR_CHAN_GAUGE_FULL_AVAIL_CAPACITY | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_AVG_POWER | ||
#undef SENSOR_CHAN_GAUGE_AVG_POWER | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_STATE_OF_HEALTH | ||
#undef SENSOR_CHAN_GAUGE_STATE_OF_HEALTH | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_TIME_TO_EMPTY | ||
#undef SENSOR_CHAN_GAUGE_TIME_TO_EMPTY | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_TIME_TO_FULL | ||
#undef SENSOR_CHAN_GAUGE_TIME_TO_FULL | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_CYCLE_COUNT | ||
#undef SENSOR_CHAN_GAUGE_CYCLE_COUNT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_DESIGN_VOLTAGE | ||
#undef SENSOR_CHAN_GAUGE_DESIGN_VOLTAGE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_DESIRED_VOLTAGE | ||
#undef SENSOR_CHAN_GAUGE_DESIRED_VOLTAGE | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_GAUGE_DESIRED_CHARGING_CURRENT | ||
#undef SENSOR_CHAN_GAUGE_DESIRED_CHARGING_CURRENT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_ALL | ||
#undef SENSOR_CHAN_ALL | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_COMMON_COUNT | ||
#undef SENSOR_CHAN_COMMON_COUNT | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_PRIV_START | ||
#undef SENSOR_CHAN_PRIV_START | ||
#endif | ||
|
||
#ifdef SENSOR_CHAN_MAX | ||
#undef SENSOR_CHAN_MAX | ||
#endif | ||
|
||
#endif /* INCLUDE_ZEPHYR_DRIVERS_SENSOR_CHANNEL_SHIM_H_ */ |
Oops, something went wrong.