RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
sensor_v2.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2006-2023, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2019-01-31 flybreak first version
9 * 2022-12-17 Meco Man re-implement sensor framework
10 */
11
12#ifndef __SENSOR_H__
13#define __SENSOR_H__
14
15#include <rtthread.h>
16#include "dev_pin.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#ifdef RT_USING_RTC
23#define rt_sensor_get_ts() time(RT_NULL) /* API for the sensor to get the timestamp */
24#else
25#define rt_sensor_get_ts() rt_tick_get() /* API for the sensor to get the timestamp */
26#endif
27
28#define RT_DEVICE_FLAG_FIFO_RX 0x200 /* Flag to use when the sensor is open by fifo mode */
29
30#define RT_SENSOR_MODULE_MAX (3) /* The maximum number of members of a sensor module */
31
32#define RT_SENSOR_MACRO_GET_NAME(macro) (macro##_STR)
33
34/* Sensor types */
35#define RT_SENSOR_TYPE_NONE (0)
36#define RT_SENSOR_TYPE_NONE_STR "None"
37#define RT_SENSOR_TYPE_ACCE (1)
38#define RT_SENSOR_TYPE_ACCE_STR "Accelerometer"
39#define RT_SENSOR_TYPE_GYRO (2)
40#define RT_SENSOR_TYPE_GYRO_STR "Gyroscope"
41#define RT_SENSOR_TYPE_MAG (3)
42#define RT_SENSOR_TYPE_MAG_STR "Magnetometer"
43#define RT_SENSOR_TYPE_TEMP (4)
44#define RT_SENSOR_TYPE_TEMP_STR "Temperature"
45#define RT_SENSOR_TYPE_HUMI (5)
46#define RT_SENSOR_TYPE_HUMI_STR "Relative Humidity"
47#define RT_SENSOR_TYPE_BARO (6)
48#define RT_SENSOR_TYPE_BARO_STR "Barometer"
49#define RT_SENSOR_TYPE_LIGHT (7)
50#define RT_SENSOR_TYPE_LIGHT_STR "Ambient Light"
51#define RT_SENSOR_TYPE_PROXIMITY (8)
52#define RT_SENSOR_TYPE_PROXIMITY_STR "Proximity"
53#define RT_SENSOR_TYPE_HR (9)
54#define RT_SENSOR_TYPE_HR_STR "Heart Rate"
55#define RT_SENSOR_TYPE_TVOC (10)
56#define RT_SENSOR_TYPE_TVOC_STR "TVOC Level"
57#define RT_SENSOR_TYPE_NOISE (11)
58#define RT_SENSOR_TYPE_NOISE_STR "Noise Loudness"
59#define RT_SENSOR_TYPE_STEP (12)
60#define RT_SENSOR_TYPE_STEP_STR "Step"
61#define RT_SENSOR_TYPE_FORCE (13)
62#define RT_SENSOR_TYPE_FORCE_STR "Force"
63#define RT_SENSOR_TYPE_DUST (14)
64#define RT_SENSOR_TYPE_DUST_STR "Dust"
65#define RT_SENSOR_TYPE_ECO2 (15)
66#define RT_SENSOR_TYPE_ECO2_STR "eCO2"
67#define RT_SENSOR_TYPE_GNSS (16)
68#define RT_SENSOR_TYPE_GNSS_STR "GNSS"
69#define RT_SENSOR_TYPE_TOF (17)
70#define RT_SENSOR_TYPE_TOF_STR "ToF"
71#define RT_SENSOR_TYPE_SPO2 (18)
72#define RT_SENSOR_TYPE_SPO2_STR "SpO2"
73#define RT_SENSOR_TYPE_IAQ (19)
74#define RT_SENSOR_TYPE_IAQ_STR "IAQ"
75#define RT_SENSOR_TYPE_ETOH (20)
76#define RT_SENSOR_TYPE_ETOH_STR "EtOH"
77#define RT_SENSOR_TYPE_BP (21)
78#define RT_SENSOR_TYPE_BP_STR "Blood Pressure"
79#define RT_SENSOR_TYPE_VOLTAGE (22)
80#define RT_SENSOR_TYPE_VOLTAGE_STR "Voltage"
81#define RT_SENSOR_TYPE_CURRENT (23)
82#define RT_SENSOR_TYPE_CURRENT_STR "Current"
83
84/* Sensor vendor types */
85#define RT_SENSOR_VENDOR_UNKNOWN (0)
86#define RT_SENSOR_VENDOR_UNKNOWN_STR "Unknown"
87#define RT_SENSOR_VENDOR_VIRTUAL (1)
88#define RT_SENSOR_VENDOR_VIRTUAL_STR "Virtual Sensor"
89#define RT_SENSOR_VENDOR_ONCHIP (2)
90#define RT_SENSOR_VENDOR_ONCHIP_STR "OnChip"
91#define RT_SENSOR_VENDOR_STM (3)
92#define RT_SENSOR_VENDOR_STM_STR "STMicroelectronics"
93#define RT_SENSOR_VENDOR_BOSCH (4)
94#define RT_SENSOR_VENDOR_BOSCH_STR "Bosch"
95#define RT_SENSOR_VENDOR_INVENSENSE (5)
96#define RT_SENSOR_VENDOR_INVENSENSE_STR "Invensense"
97#define RT_SENSOR_VENDOR_SEMTECH (6)
98#define RT_SENSOR_VENDOR_SEMTECH_STR "Semtech"
99#define RT_SENSOR_VENDOR_GOERTEK (7)
100#define RT_SENSOR_VENDOR_GOERTEK_STR "Goertek"
101#define RT_SENSOR_VENDOR_MIRAMEMS (8)
102#define RT_SENSOR_VENDOR_MIRAMEMS_STR "MiraMEMS"
103#define RT_SENSOR_VENDOR_DALLAS (9)
104#define RT_SENSOR_VENDOR_DALLAS_STR "Dallas"
105#define RT_SENSOR_VENDOR_ASAIR (10)
106#define RT_SENSOR_VENDOR_ASAIR_STR "Aosong"
107#define RT_SENSOR_VENDOR_SHARP (11)
108#define RT_SENSOR_VENDOR_SHARP_STR "Sharp"
109#define RT_SENSOR_VENDOR_SENSIRION (12)
110#define RT_SENSOR_VENDOR_SENSIRION_STR "Sensirion"
111#define RT_SENSOR_VENDOR_TI (13)
112#define RT_SENSOR_VENDOR_TI_STR "Texas Instruments"
113#define RT_SENSOR_VENDOR_PLANTOWER (14)
114#define RT_SENSOR_VENDOR_PLANTOWER_STR "Plantower"
115#define RT_SENSOR_VENDOR_AMS (15)
116#define RT_SENSOR_VENDOR_AMS_STR "ams-OSRAM AG"
117#define RT_SENSOR_VENDOR_MAXIM (16)
118#define RT_SENSOR_VENDOR_MAXIM_STR "Maxim Integrated"
119#define RT_SENSOR_VENDOR_MELEXIS (17)
120#define RT_SENSOR_VENDOR_MELEXIS_STR "Melexis"
121#define RT_SENSOR_VENDOR_LSC (18)
122#define RT_SENSOR_VENDOR_LSC_STR "Lite On"
123
124/* Sensor unit types */
125#define RT_SENSOR_UNIT_NONE (0) /* Dimensionless quantity */
126#define RT_SENSOR_UNIT_NONE_STR ""
127#define RT_SENSOR_UNIT_MG (1) /* Accelerometer unit: mG */
128#define RT_SENSOR_UNIT_MG_STR "mG"
129#define RT_SENSOR_UNIT_MDPS (2) /* Gyroscope unit: mdps */
130#define RT_SENSOR_UNIT_MDPS_STR "mdps"
131#define RT_SENSOR_UNIT_MGAUSS (3) /* Magnetometer unit: mGauss */
132#define RT_SENSOR_UNIT_MGAUSS_STR "mGauss"
133#define RT_SENSOR_UNIT_LUX (4) /* Ambient light unit: lux */
134#define RT_SENSOR_UNIT_LUX_STR "lux"
135#define RT_SENSOR_UNIT_M (5) /* Distance unit: m */
136#define RT_SENSOR_UNIT_M_STR "m"
137#define RT_SENSOR_UNIT_CM (6) /* Distance unit: cm */
138#define RT_SENSOR_UNIT_CM_STR "cm"
139#define RT_SENSOR_UNIT_MM (7) /* Distance unit: mm */
140#define RT_SENSOR_UNIT_MM_STR "mm"
141#define RT_SENSOR_UNIT_PA (8) /* Barometer unit: Pa */
142#define RT_SENSOR_UNIT_PA_STR "Pa"
143#define RT_SENSOR_UNIT_MMHG (9) /* Blood Pressure unit: mmHg */
144#define RT_SENSOR_UNIT_MMHG_STR "mmHg"
145#define RT_SENSOR_UNIT_PERCENTAGE (10) /* Relative Humidity unit: percentage */
146#define RT_SENSOR_UNIT_PERCENTAGE_STR "%"
147#define RT_SENSOR_UNIT_PERMILLAGE (11) /* Relative Humidity unit: permillage */
148#define RT_SENSOR_UNIT_PERMILLAGE_STR "‰"
149#define RT_SENSOR_UNIT_CELSIUS (12) /* Temperature unit: Celsius ℃ */
150#define RT_SENSOR_UNIT_CELSIUS_STR "℃"
151#define RT_SENSOR_UNIT_FAHRENHEIT (13) /* Temperature unit: Fahrenheit ℉ */
152#define RT_SENSOR_UNIT_FAHRENHEIT_STR "℉"
153#define RT_SENSOR_UNIT_KELVIN (14) /* Temperature unit: Kelvin K */
154#define RT_SENSOR_UNIT_KELVIN_STR "K"
155#define RT_SENSOR_UNIT_HZ (15) /* Frequency unit: Hz */
156#define RT_SENSOR_UNIT_HZ_STR "Hz"
157#define RT_SENSOR_UNIT_V (16) /* Voltage unit: V */
158#define RT_SENSOR_UNIT_V_STR "V"
159#define RT_SENSOR_UNIT_MV (17) /* Voltage unit: mV */
160#define RT_SENSOR_UNIT_MV_STR "mV"
161#define RT_SENSOR_UNIT_A (18) /* Current unit: A */
162#define RT_SENSOR_UNIT_A_STR "A"
163#define RT_SENSOR_UNIT_MA (19) /* Current unit: mA */
164#define RT_SENSOR_UNIT_MA_STR "mA"
165#define RT_SENSOR_UNIT_N (20) /* Force unit: N */
166#define RT_SENSOR_UNIT_N_STR "N"
167#define RT_SENSOR_UNIT_MN (21) /* Force unit: mN */
168#define RT_SENSOR_UNIT_MN_STR "mN"
169#define RT_SENSOR_UNIT_BPM (22) /* Heart rate unit: bpm */
170#define RT_SENSOR_UNIT_BPM_STR "bpm"
171#define RT_SENSOR_UNIT_PPM (23) /* Concentration unit: ppm */
172#define RT_SENSOR_UNIT_PPM_STR "ppm"
173#define RT_SENSOR_UNIT_PPB (24) /* Concentration unit: ppb */
174#define RT_SENSOR_UNIT_PPB_STR "ppb"
175#define RT_SENSOR_UNIT_DMS (25) /* Coordinates unit: DMS */
176#define RT_SENSOR_UNIT_DMS_STR "DMS"
177#define RT_SENSOR_UNIT_DD (26) /* Coordinates unit: DD */
178#define RT_SENSOR_UNIT_DD_STR "DD"
179#define RT_SENSOR_UNIT_MGM3 (27) /* Concentration unit: mg/m3 */
180#define RT_SENSOR_UNIT_MGM3_STR "mg/m3"
181
182/* Sensor communication interface types */
183#define RT_SENSOR_INTF_I2C (1 << 0)
184#define RT_SENSOR_INTF_I2C_STR "I2C"
185#define RT_SENSOR_INTF_SPI (1 << 1)
186#define RT_SENSOR_INTF_SPI_STR "SPI"
187#define RT_SENSOR_INTF_UART (1 << 2)
188#define RT_SENSOR_INTF_UART_STR "UART"
189#define RT_SENSOR_INTF_ONEWIRE (1 << 3)
190#define RT_SENSOR_INTF_ONEWIRE_STR "1-Wire"
191#define RT_SENSOR_INTF_CAN (1 << 4)
192#define RT_SENSOR_INTF_CAN_STR "CAN"
193#define RT_SENSOR_INTF_MODBUS (1 << 5)
194#define RT_SENSOR_INTF_MODBUS_STR "Modbus"
195
202#define RT_SENSOR_MODE_ACCURACY_BIT_OFFSET (8)
203#define RT_SENSOR_MODE_POWER_BIT_OFFSET (4)
204#define RT_SENSOR_MODE_FETCH_BIT_OFFSET (0)
205
206#define RT_SENSOR_MODE_GET_ACCURACY(mode) (rt_uint8_t)((mode >> RT_SENSOR_MODE_ACCURACY_BIT_OFFSET) & 0x0F)
207#define RT_SENSOR_MODE_GET_POWER(mode) (rt_uint8_t)((mode >> RT_SENSOR_MODE_POWER_BIT_OFFSET) & 0x0F)
208#define RT_SENSOR_MODE_GET_FETCH(mode) (rt_uint8_t)((mode >> RT_SENSOR_MODE_FETCH_BIT_OFFSET) & 0x0F)
209
210#define RT_SENSOR_MODE_CLEAR_ACCURACY(mode) (mode &= ((rt_uint16_t)~((rt_uint16_t)0x0F << RT_SENSOR_MODE_ACCURACY_BIT_OFFSET)))
211#define RT_SENSOR_MODE_CLEAR_POWER(mode) (mode &= ((rt_uint16_t)~((rt_uint16_t)0x0F << RT_SENSOR_MODE_POWER_BIT_OFFSET)))
212#define RT_SENSOR_MODE_CLEAR_FETCH(mode) (mode &= ((rt_uint16_t)~((rt_uint16_t)0x0F << RT_SENSOR_MODE_FETCH_BIT_OFFSET)))
213
214#define RT_SENSOR_MODE_SET_ACCURACY(mode, accuracy_mode) RT_SENSOR_MODE_CLEAR_ACCURACY(mode); (mode |= (accuracy_mode << RT_SENSOR_MODE_ACCURACY_BIT_OFFSET))
215#define RT_SENSOR_MODE_SET_POWER(mode, power_mode) RT_SENSOR_MODE_CLEAR_POWER(mode); (mode |= (power_mode << RT_SENSOR_MODE_POWER_BIT_OFFSET))
216#define RT_SENSOR_MODE_SET_FETCH(mode, fetch_mode) RT_SENSOR_MODE_CLEAR_FETCH(mode); (mode |= (fetch_mode << RT_SENSOR_MODE_FETCH_BIT_OFFSET))
217
218/* Sensor mode: accuracy */
219#define RT_SENSOR_MODE_ACCURACY_HIGHEST (0)
220#define RT_SENSOR_MODE_ACCURACY_HIGHEST_STR "Accuracy Highest"
221#define RT_SENSOR_MODE_ACCURACY_HIGH (1)
222#define RT_SENSOR_MODE_ACCURACY_HIGH_STR "Accuracy High"
223#define RT_SENSOR_MODE_ACCURACY_MEDIUM (2)
224#define RT_SENSOR_MODE_ACCURACY_MEDIUM_STR "Accuracy Medium"
225#define RT_SENSOR_MODE_ACCURACY_LOW (3)
226#define RT_SENSOR_MODE_ACCURACY_LOW_STR "Accuracy Low"
227#define RT_SENSOR_MODE_ACCURACY_LOWEST (4)
228#define RT_SENSOR_MODE_ACCURACY_LOWEST_STR "Accuracy Lowest"
229#define RT_SENSOR_MODE_ACCURACY_NOTRUST (5)
230#define RT_SENSOR_MODE_ACCURACY_NOTRUST_STR "Accuracy No Trust"
231
232/* Sensor mode: power */
233#define RT_SENSOR_MODE_POWER_HIGHEST (0)
234#define RT_SENSOR_MODE_POWER_HIGHEST_STR "Power Highest"
235#define RT_SENSOR_MODE_POWER_HIGH (1)
236#define RT_SENSOR_MODE_POWER_HIGH_STR "Power High"
237#define RT_SENSOR_MODE_POWER_MEDIUM (2)
238#define RT_SENSOR_MODE_POWER_MEDIUM_STR "Power Medium"
239#define RT_SENSOR_MODE_POWER_LOW (3)
240#define RT_SENSOR_MODE_POWER_LOW_STR "Power Low"
241#define RT_SENSOR_MODE_POWER_LOWEST (4)
242#define RT_SENSOR_MODE_POWER_LOWEST_STR "Power Lowest"
243#define RT_SENSOR_MODE_POWER_DOWN (5)
244#define RT_SENSOR_MODE_POWER_DOWN_STR "Power Down"
245
246/* Sensor mode: fetch data */
247#define RT_SENSOR_MODE_FETCH_POLLING (0) /* One shot only read a data */
248#define RT_SENSOR_MODE_FETCH_POLLING_STR "Polling Mode"
249#define RT_SENSOR_MODE_FETCH_INT (1) /* TODO: One shot interrupt only read a data */
250#define RT_SENSOR_MODE_FETCH_INT_STR "Interrupt Mode"
251#define RT_SENSOR_MODE_FETCH_FIFO (2) /* TODO: One shot interrupt read all fifo data */
252#define RT_SENSOR_MODE_FETCH_FIFO_STR "FIFO Mode"
253
254/* Sensor control cmd types */
255#define RT_SENSOR_CTRL_GET_ID (RT_DEVICE_CTRL_BASE(Sensor) + 0) /* Get device id */
256#define RT_SENSOR_CTRL_SELF_TEST (RT_DEVICE_CTRL_BASE(Sensor) + 1) /* Take a self test */
257#define RT_SENSOR_CTRL_SOFT_RESET (RT_DEVICE_CTRL_BASE(Sensor) + 2) /* soft reset sensor */
258#define RT_SENSOR_CTRL_SET_FETCH_MODE (RT_DEVICE_CTRL_BASE(Sensor) + 3) /* set fetch data mode */
259#define RT_SENSOR_CTRL_SET_POWER_MODE (RT_DEVICE_CTRL_BASE(Sensor) + 4) /* set power mode */
260#define RT_SENSOR_CTRL_SET_ACCURACY_MODE (RT_DEVICE_CTRL_BASE(Sensor) + 5) /* set accuracy mode */
261
262#define RT_SENSOR_CTRL_USER_CMD_START 0x100 /* User commands should be greater than 0x100 */
263
264/* sensor floating data type */
265#ifdef RT_USING_SENSOR_DOUBLE_FLOAT
266typedef double rt_sensor_float_t;
267#else
268typedef float rt_sensor_float_t;
269#endif /* RT_USING_SENSOR_DOUBLE_FLOAT */
270
272{
273 rt_sensor_float_t resolution; /* resolution of sesnor measurement */
274 rt_sensor_float_t error; /* error of sesnor measurement */
275};
276
278{
279 rt_sensor_float_t range_max; /* maximum range of this sensor's value. unit is 'unit' */
280 rt_sensor_float_t range_min; /* minimum range of this sensor's value. unit is 'unit' */
281};
282
283struct rt_sensor_info
284{
285 rt_uint8_t type; /* sensor type */
286 rt_uint8_t vendor; /* sensors vendor */
287 const char *name; /* name of sensor */
288 rt_uint8_t unit; /* unit of measurement */
289 rt_uint8_t intf_type; /* communication interface type */
290 rt_uint16_t mode; /* sensor work mode */
292 rt_sensor_float_t acquire_min; /* minimum acquirement period, unit:ms. zero = not a constant rate */
293 struct rt_sensor_accuracy accuracy; /* sensor current measure accuracy */
294 struct rt_sensor_scale scale; /* sensor current scale range */
295};
296
297struct rt_sensor_intf
298{
299 char *dev_name; /* The name of the communication device */
300 rt_uint8_t type; /* Communication interface type */
301 void *arg; /* Interface argument for the sensor. ex. i2c addr,spi cs,control I/O */
302};
303
304struct rt_sensor_config
305{
306 struct rt_sensor_intf intf; /* sensor interface config */
307 struct rt_device_pin_mode irq_pin; /* Interrupt pin, The purpose of this pin is to notification read data */
308};
309
315
316struct rt_sensor_device
317{
318 struct rt_device parent; /* The standard device */
319
320 struct rt_sensor_info info; /* The sensor info data */
321 struct rt_sensor_config config; /* The sensor config data */
322
323 rt_sensor_data_t data_buf; /* The buf of the data received */
324 rt_size_t data_len; /* The size of the data received */
325
326 const struct rt_sensor_ops *ops; /* The sensor ops */
327
328 struct rt_sensor_module *module; /* The sensor module */
329
330 rt_err_t (*irq_handle)(rt_sensor_t sensor); /* Called when an interrupt is generated, registered by the driver */
331};
332
333struct rt_sensor_module
334{
335 rt_mutex_t lock; /* The module lock */
336
337 rt_sensor_t sen[RT_SENSOR_MODULE_MAX]; /* The module contains a list of sensors */
338 rt_uint8_t sen_num; /* Number of sensors contained in the module */
339};
340
341/* 3-axis Data Type */
342struct sensor_3_axis
343{
347};
348
349/* Blood Pressure Data Type */
350struct sensor_bp
351{
352 rt_sensor_float_t sbp; /* SBP : systolic pressure */
353 rt_sensor_float_t dbp; /* DBP : diastolic pressure */
354};
355
356struct coordinates
357{
360};
361
362struct rt_sensor_data
363{
364 rt_uint32_t timestamp; /* The timestamp when the data was received */
365 rt_uint8_t type; /* The sensor type of the data */
366 union
367 {
368 struct sensor_3_axis acce; /* Accelerometer. unit: mG */
369 struct sensor_3_axis gyro; /* Gyroscope. unit: mdps */
370 struct sensor_3_axis mag; /* Magnetometer. unit: mGauss */
371 struct coordinates coord; /* Coordinates unit: degrees */
372 struct sensor_bp bp; /* BloodPressure. unit: mmHg */
373 rt_sensor_float_t temp; /* Temperature. unit: dCelsius */
374 rt_sensor_float_t humi; /* Relative humidity. unit: permillage */
375 rt_sensor_float_t baro; /* Pressure. unit: pascal (Pa) */
376 rt_sensor_float_t light; /* Light. unit: lux */
377 rt_sensor_float_t proximity; /* Distance. unit: centimeters */
378 rt_sensor_float_t hr; /* Heart rate. unit: bpm */
379 rt_sensor_float_t tvoc; /* TVOC. unit: permillage */
380 rt_sensor_float_t noise; /* Noise Loudness. unit: HZ */
381 rt_sensor_float_t step; /* Step sensor. unit: 1 */
382 rt_sensor_float_t force; /* Force sensor. unit: mN */
383 rt_sensor_float_t dust; /* Dust sensor. unit: ug/m3 */
384 rt_sensor_float_t eco2; /* eCO2 sensor. unit: ppm */
385 rt_sensor_float_t spo2; /* SpO2 sensor. unit: permillage */
386 rt_sensor_float_t iaq; /* IAQ sensor. unit: 1 */
387 rt_sensor_float_t etoh; /* EtOH sensor. unit: ppm */
389};
390
391struct rt_sensor_ops
392{
394 rt_err_t (*control)(rt_sensor_t sensor, int cmd, void *arg);
395};
396
398 const char *name,
399 rt_uint32_t flag,
400 void *data);
402
403#ifdef __cplusplus
404}
405#endif
406
407#endif /* __SENSOR_H__ */
struct rt_mutex * rt_mutex_t
rt_base_t rt_ssize_t
rt_base_t rt_err_t
unsigned char rt_uint8_t
unsigned short rt_uint16_t
rt_ubase_t rt_size_t
unsigned int rt_uint32_t
#define RT_SENSOR_MODULE_MAX
struct rt_sensor_device * rt_sensor_t
struct rt_sensor_scale * rt_sensor_scale_t
struct rt_sensor_info * rt_sensor_info_t
float rt_sensor_float_t
int rt_hw_sensor_register(rt_sensor_t sensor, const char *name, rt_uint32_t flag, void *data)
rt_sensor_t rt_sensor_device_find(const char *name)
struct rt_sensor_device * rt_sensor_t
struct rt_sensor_accuracy * rt_sensor_accuracy_t
struct rt_sensor_data * rt_sensor_data_t
double latitude
double longitude
pin mode structure
rt_sensor_float_t resolution
rt_sensor_float_t error
struct rt_sensor_intf intf
struct rt_device_pin_mode irq_pin
rt_int32_t baro
struct sensor_3_axis mag
rt_int32_t hr
struct coordinates coord
union rt_sensor_data::@022165123134134131071120365022351202312371364346 data
rt_uint32_t spo2
rt_uint32_t eco2
rt_uint8_t type
struct sensor_bp bp
rt_uint32_t timestamp
struct sensor_3_axis gyro
rt_uint32_t iaq
rt_int32_t tvoc
rt_uint32_t step
rt_int32_t force
rt_int32_t noise
struct sensor_3_axis acce
rt_int32_t humi
rt_uint32_t etoh
rt_int32_t light
rt_int32_t proximity
rt_uint32_t dust
rt_int32_t temp
struct rt_device parent
struct rt_sensor_module * module
const struct rt_sensor_ops * ops
struct rt_sensor_info info
struct rt_sensor_config config
rt_err_t(* irq_handle)(rt_sensor_t sensor)
const char * name
rt_uint8_t vendor
rt_sensor_float_t acquire_min
struct rt_sensor_scale scale
rt_uint8_t fifo_max
rt_uint8_t type
rt_uint8_t unit
struct rt_sensor_accuracy accuracy
rt_uint8_t intf_type
rt_uint8_t type
rt_sensor_t sen[RT_SENSOR_MODULE_MAX]
rt_uint8_t sen_num
rt_ssize_t(* fetch_data)(struct rt_sensor_device *sensor, void *buf, rt_size_t len)
rt_err_t(* control)(struct rt_sensor_device *sensor, int cmd, void *arg)
rt_sensor_float_t range_min
rt_sensor_float_t range_max
rt_int32_t x
rt_int32_t y
rt_int32_t z
rt_int32_t dbp
rt_int32_t sbp