Skip to content

Commit 899eeb3

Browse files
Donny9xiaoxiang781216
authored andcommitted
1 parent 2cf92a7 commit 899eeb3

File tree

2 files changed

+56
-56
lines changed

2 files changed

+56
-56
lines changed

drivers/sensors/sensor.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,35 +161,35 @@ static const struct sensor_meta_s g_sensor_meta[] =
161161
{0, NULL},
162162
{sizeof(struct sensor_accel), "accel"},
163163
{sizeof(struct sensor_mag), "mag"},
164+
{sizeof(struct sensor_uv), "uv"},
164165
{sizeof(struct sensor_gyro), "gyro"},
165166
{sizeof(struct sensor_light), "light"},
166167
{sizeof(struct sensor_baro), "baro"},
168+
{sizeof(struct sensor_noise), "noise"},
167169
{sizeof(struct sensor_prox), "prox"},
168-
{sizeof(struct sensor_humi), "humi"},
169-
{sizeof(struct sensor_temp), "temp"},
170170
{sizeof(struct sensor_rgb), "rgb"},
171171
{sizeof(struct sensor_hall), "hall"},
172172
{sizeof(struct sensor_ir), "ir"},
173-
{sizeof(struct sensor_uv), "uv"},
174-
{sizeof(struct sensor_noise), "noise"},
173+
{sizeof(struct sensor_humi), "humi"},
174+
{sizeof(struct sensor_temp), "temp"},
175175
{sizeof(struct sensor_pm25), "pm25"},
176176
{sizeof(struct sensor_pm1p0), "pm1p0"},
177177
{sizeof(struct sensor_pm10), "pm10"},
178178
{sizeof(struct sensor_co2), "co2"},
179179
{sizeof(struct sensor_hcho), "hcho"},
180180
{sizeof(struct sensor_tvoc), "tvoc"},
181181
{sizeof(struct sensor_ph), "ph"},
182-
{sizeof(struct sensor_dust), "dust"},
183182
{sizeof(struct sensor_hrate), "hrate"},
184-
{sizeof(struct sensor_hbeat), "hbeat"},
183+
{sizeof(struct sensor_dust), "dust"},
184+
{sizeof(struct sensor_wake_gesture), "wake_gesture"},
185185
{sizeof(struct sensor_ecg), "ecg"},
186186
{sizeof(struct sensor_ppgd), "ppgd"},
187187
{sizeof(struct sensor_ppgq), "ppgq"},
188188
{sizeof(struct sensor_impd), "impd"},
189189
{sizeof(struct sensor_ots), "ots"},
190-
{sizeof(struct sensor_wake_gesture), "wake_gesture"},
191-
{sizeof(struct sensor_cap), "cap"},
192190
{sizeof(struct sensor_gas), "gas"},
191+
{sizeof(struct sensor_cap), "cap"},
192+
{sizeof(struct sensor_hbeat), "hbeat"},
193193
{sizeof(struct sensor_force), "force"},
194194
{sizeof(struct sensor_gnss), "gnss"},
195195
{sizeof(struct sensor_gnss_satellite), "gnss_satellite"},

include/nuttx/uorb.h

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -63,45 +63,45 @@
6363

6464
#define SENSOR_TYPE_MAGNETIC_FIELD 2
6565

66+
/* Ultraviolet light sensor
67+
* This sensor can identify the UV index in ambient light help people
68+
* to effectively protect themselves from sunburns, cancer or eye damage.
69+
* This value range is 0 - 15.
70+
*/
71+
#define SENSOR_TYPE_ULTRAVIOLET 3
72+
6673
/* Gyroscope
6774
* All values are in radians/second and measure the rate of rotation around
6875
* the X, Y and Z axis.
6976
*/
7077

71-
#define SENSOR_TYPE_GYROSCOPE 3
78+
#define SENSOR_TYPE_GYROSCOPE 4
7279

7380
/* Ambient Light
7481
* The ambient light sensor value is returned in SI units lux.
7582
*/
7683

77-
#define SENSOR_TYPE_LIGHT 4
84+
#define SENSOR_TYPE_LIGHT 5
7885

7986
/* Barometer
8087
* All values are in hectopascal (hPa) and measure the athmospheric pressure.
8188
* You can calculate altitude by perssure.
8289
*/
8390

84-
#define SENSOR_TYPE_BAROMETER 5
85-
86-
/* Proximity
87-
* The values correspond to the distance to the nearest
88-
* object in centimeters.
89-
*/
90-
91-
#define SENSOR_TYPE_PROXIMITY 6
91+
#define SENSOR_TYPE_BAROMETER 6
9292

93-
/* Relative Humidity
94-
* A relative humidity sensor measure relative ambient air humidity and
95-
* return a value in percent.
93+
/* Noise Loudness
94+
* A sensor of this type returns the loudness of noise in SI units (db)
9695
*/
9796

98-
#define SENSOR_TYPE_RELATIVE_HUMIDITY 7
97+
#define SENSOR_TYPE_NOISE 7
9998

100-
/* Ambient Temperature
101-
* The ambient (room) temperature in degree Celsius
99+
/* Proximity
100+
* The values correspond to the distance to the nearest
101+
* object in centimeters.
102102
*/
103103

104-
#define SENSOR_TYPE_AMBIENT_TEMPERATURE 8
104+
#define SENSOR_TYPE_PROXIMITY 8
105105

106106
/* RGB
107107
* We use these values of RGB to weighted to obtain the color of LED.
@@ -124,18 +124,18 @@
124124

125125
#define SENSOR_TYPE_IR 11
126126

127-
/* Ultraviolet light sensor
128-
* This sensor can identify the UV index in ambient light help people
129-
* to effectively protect themselves from sunburns, cancer or eye damage.
130-
* This value range is 0 - 15.
127+
/* Relative Humidity
128+
* A relative humidity sensor measure relative ambient air humidity and
129+
* return a value in percent.
131130
*/
132-
#define SENSOR_TYPE_ULTRAVIOLET 12
133131

134-
/* Noise Loudness
135-
* A sensor of this type returns the loudness of noise in SI units (db)
132+
#define SENSOR_TYPE_RELATIVE_HUMIDITY 12
133+
134+
/* Ambient Temperature
135+
* The ambient (room) temperature in degree Celsius
136136
*/
137137

138-
#define SENSOR_TYPE_NOISE 13
138+
#define SENSOR_TYPE_AMBIENT_TEMPERATURE 13
139139

140140
/* PM25
141141
* A sensor of this type returns the content of pm2.5 in the air
@@ -188,27 +188,28 @@
188188

189189
#define SENSOR_TYPE_PH 20
190190

191-
/* Dust
192-
* A sensor of this type returns the content of dust in the air
193-
* values is in ug/m^3.
194-
*/
195-
196-
#define SENSOR_TYPE_DUST 21
197-
198191
/* Heart Rate
199192
* A sensor of this type returns the current heart rate.
200193
* Current heart rate is in beats per minute (BPM).
201194
*/
202195

203-
#define SENSOR_TYPE_HEART_RATE 22
196+
#define SENSOR_TYPE_HEART_RATE 21
204197

205-
/* Heart Beat
206-
* A sensor of this type returns an event evetytime
207-
* a hear beat peek is detected. Peak here ideally corresponds
208-
* to the positive peak in the QRS complex of and ECG signal.
198+
/* Dust
199+
* A sensor of this type returns the content of dust in the air
200+
* values is in ug/m^3.
209201
*/
210202

211-
#define SENSOR_TYPE_HEART_BEAT 23
203+
#define SENSOR_TYPE_DUST 22
204+
205+
/* Wake gesture
206+
* A sensor enabling waking up the device based on a device specific
207+
* motion. 0: the device should sleep, 1: the device should wake up.
208+
* Other values ​​are uncalibrated values ​​reported by the driver to
209+
* uncalibrated topics.
210+
*/
211+
212+
#define SENSOR_TYPE_WAKE_GESTURE 23
212213

213214
/* ECG (Electrocardiogram)
214215
* A sensor of this type returns the ECG voltage in μV. Sensors may amplify
@@ -257,14 +258,12 @@
257258

258259
#define SENSOR_TYPE_OTS 28
259260

260-
/* Wake gesture
261-
* A sensor enabling waking up the device based on a device specific
262-
* motion. 0: the device should sleep, 1: the device should wake up.
263-
* Other values ​​are uncalibrated values ​​reported by the driver to
264-
* uncalibrated topics.
261+
/* Gas sensor
262+
* This sensor measures the gas resistance, indicating the presence
263+
* of volatile organic compounds in the air.
265264
*/
266265

267-
#define SENSOR_TYPE_WAKE_GESTURE 29
266+
#define SENSOR_TYPE_GAS 29
268267

269268
/* CAP (Capacitive proximity sensor)
270269
* The purpose of the proximity sensing interface is to detect when a
@@ -274,12 +273,13 @@
274273

275274
#define SENSOR_TYPE_CAP 30
276275

277-
/* Gas sensor
278-
* This sensor measures the gas resistance, indicating the presence
279-
* of volatile organic compounds in the air.
276+
/* Heart Beat
277+
* A sensor of this type returns an event evetytime
278+
* a hear beat peek is detected. Peak here ideally corresponds
279+
* to the positive peak in the QRS complex of and ECG signal.
280280
*/
281281

282-
#define SENSOR_TYPE_GAS 31
282+
#define SENSOR_TYPE_HEART_BEAT 31
283283

284284
/* Force
285285
* A sensor of this type measures the force on it, and additionally

0 commit comments

Comments
 (0)