ariel_os_sensors/category.rs
1/// Categories a sensor driver can be part of.
2///
3/// A sensor driver may be part of multiple categories.
4///
5/// # For sensor driver implementors
6///
7/// Many MEMS sensor devices (e.g., accelerometers) include a temperature sensing element in
8/// addition to their main sensing element, as temperature may slightly affect the measurement
9/// results.
10/// Sensor *drivers* are not under the obligation of exposing such temperature readings, even if
11/// they are exposed by the sensor device.
12/// They may however still be fetched by the sensor driver internally, especially to dynamically
13/// compute the accuracy of the main reading returned by the sensor driver.
14/// If temperature readings are not exposed by the sensor driver, the sensor driver must not be
15/// considered part of a category that includes temperature ([`Category::Temperature`] or
16/// [`Category::AccelerometerTemperature`] in the case of an accelerometer), even if the sensor
17/// *device* does expose them.
18/// One reason to *not* expose the extra readings is a lack of precision or accuracy with the extra
19/// sensing element.
20///
21/// Sensor drivers may be part of multiple categories and should then list all of them: e.g., being
22/// part of the [`Category::AccelerometerTemperature`] does *not* imply also being part of the
23/// [`Category::Accelerometer`] category, and the sensor driver must list both of them.
24///
25/// Missing variants can be added when required.
26/// Please open an issue to discuss it.
27// Built upon https://doc.riot-os.org/group__drivers__saul.html#ga8f2dfec7e99562dbe5d785467bb71bbb
28#[derive(Debug, Copy, Clone, PartialEq, Eq)]
29#[cfg_attr(feature = "defmt", derive(defmt::Format))]
30#[non_exhaustive]
31pub enum Category {
32 /// Accelerometer.
33 Accelerometer,
34 /// Accelerometer & temperature sensor.
35 AccelerometerTemperature,
36 /// Accelerometer & gyroscope, also known as inertial measurement unit (IMU).
37 AccelerometerGyroscope,
38 /// Accelerometer & gyroscope & temperature sensor, also known as inertial measurement unit (IMU).
39 AccelerometerGyroscopeTemperature,
40 /// Accelerometer & magnetometer & temperature sensor.
41 AccelerometerMagnetometerTemperature,
42 /// Ammeter (ampere meter).
43 Ammeter,
44 /// CO₂ gas sensor.
45 Co2Gas,
46 /// Color sensor.
47 Color,
48 /// GNSS (Global Navigation Satellite System) receiver.
49 Gnss,
50 /// Gyroscope.
51 Gyroscope,
52 /// Relative humidity sensor.
53 RelativeHumidity,
54 /// Relative humidity & temperature sensor.
55 RelativeHumidityTemperature,
56 /// Light sensor.
57 Light,
58 /// Magnetometer.
59 Magnetometer,
60 /// pH sensor.
61 Ph,
62 /// Pressure sensor.
63 Pressure,
64 /// Pressure & temperature sensor.
65 PressureTemperature,
66 /// Push button.
67 PushButton,
68 /// Temperature sensor.
69 Temperature,
70 /// TVOC sensor.
71 Tvoc,
72 /// Voltage sensor.
73 Voltage,
74}