RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
|
结构体 | |
struct | rt_sensor_info |
struct | rt_sensor_intf |
struct | rt_sensor_config |
struct | rt_sensor_device |
struct | rt_sensor_module |
struct | sensor_3_axis |
struct | sensor_bp |
struct | coordinates |
struct | rt_sensor_data |
struct | rt_sensor_ops |
宏定义 | |
#define | rt_sensor_get_ts() |
#define | RT_PIN_NONE 0xFFFF /* RT PIN NONE */ |
#define | RT_DEVICE_FLAG_FIFO_RX 0x200 /* Flag to use when the sensor is open by fifo mode */ |
#define | RT_SENSOR_MODULE_MAX (3) /* The maximum number of members of a sensor module */ |
#define | RT_SENSOR_CLASS_NONE (0) |
#define | RT_SENSOR_CLASS_ACCE (1) /* Accelerometer */ |
#define | RT_SENSOR_CLASS_GYRO (2) /* Gyroscope */ |
#define | RT_SENSOR_CLASS_MAG (3) /* Magnetometer */ |
#define | RT_SENSOR_CLASS_TEMP (4) /* Temperature */ |
#define | RT_SENSOR_CLASS_HUMI (5) /* Relative Humidity */ |
#define | RT_SENSOR_CLASS_BARO (6) /* Barometer */ |
#define | RT_SENSOR_CLASS_LIGHT (7) /* Ambient light */ |
#define | RT_SENSOR_CLASS_PROXIMITY (8) /* Proximity */ |
#define | RT_SENSOR_CLASS_HR (9) /* Heart Rate */ |
#define | RT_SENSOR_CLASS_TVOC (10) /* TVOC Level */ |
#define | RT_SENSOR_CLASS_NOISE (11) /* Noise Loudness */ |
#define | RT_SENSOR_CLASS_STEP (12) /* Step sensor */ |
#define | RT_SENSOR_CLASS_FORCE (13) /* Force sensor */ |
#define | RT_SENSOR_CLASS_DUST (14) /* Dust sensor */ |
#define | RT_SENSOR_CLASS_ECO2 (15) /* eCO2 sensor */ |
#define | RT_SENSOR_CLASS_GNSS (16) /* GPS/GNSS sensor */ |
#define | RT_SENSOR_CLASS_TOF (17) /* TOF sensor */ |
#define | RT_SENSOR_CLASS_SPO2 (18) /* SpO2 sensor */ |
#define | RT_SENSOR_CLASS_IAQ (19) /* IAQ sensor. */ |
#define | RT_SENSOR_CLASS_ETOH (20) /* EtOH sensor. */ |
#define | RT_SENSOR_CLASS_BP (21) /* Blood Pressure */ |
#define | RT_SENSOR_CLASS_VOLTAGE (22) /* Voltage sensor */ |
#define | RT_SENSOR_CLASS_CURRENT (23) /* Current sensor */ |
#define | RT_SENSOR_CLASS_POWER (24) /* Power sensor */ |
#define | RT_SENSOR_VENDOR_UNKNOWN (0) |
#define | RT_SENSOR_VENDOR_STM (1) /* STMicroelectronics */ |
#define | RT_SENSOR_VENDOR_BOSCH (2) /* Bosch */ |
#define | RT_SENSOR_VENDOR_INVENSENSE (3) /* Invensense */ |
#define | RT_SENSOR_VENDOR_SEMTECH (4) /* Semtech */ |
#define | RT_SENSOR_VENDOR_GOERTEK (5) /* Goertek */ |
#define | RT_SENSOR_VENDOR_MIRAMEMS (6) /* MiraMEMS */ |
#define | RT_SENSOR_VENDOR_DALLAS (7) /* Dallas */ |
#define | RT_SENSOR_VENDOR_ASAIR (8) /* Aosong */ |
#define | RT_SENSOR_VENDOR_SHARP (9) /* Sharp */ |
#define | RT_SENSOR_VENDOR_SENSIRION (10) /* Sensirion */ |
#define | RT_SENSOR_VENDOR_TI (11) /* Texas Instruments */ |
#define | RT_SENSOR_VENDOR_PLANTOWER (12) /* Plantower */ |
#define | RT_SENSOR_VENDOR_AMS (13) /* ams AG */ |
#define | RT_SENSOR_VENDOR_MAXIM (14) /* Maxim Integrated */ |
#define | RT_SENSOR_VENDOR_MELEXIS (15) /* Melexis */ |
#define | RT_SENSOR_UNIT_NONE (0) |
#define | RT_SENSOR_UNIT_MG (1) /* Accelerometer unit: mG */ |
#define | RT_SENSOR_UNIT_MDPS (2) /* Gyroscope unit: mdps */ |
#define | RT_SENSOR_UNIT_MGAUSS (3) /* Magnetometer unit: mGauss */ |
#define | RT_SENSOR_UNIT_LUX (4) /* Ambient light unit: lux */ |
#define | RT_SENSOR_UNIT_CM (5) /* Distance unit: cm */ |
#define | RT_SENSOR_UNIT_PA (6) /* Barometer unit: pa */ |
#define | RT_SENSOR_UNIT_PERMILLAGE (7) /* Relative Humidity unit: permillage */ |
#define | RT_SENSOR_UNIT_DCELSIUS (8) /* Temperature unit: dCelsius */ |
#define | RT_SENSOR_UNIT_HZ (9) /* Frequency unit: HZ */ |
#define | RT_SENSOR_UNIT_ONE (10) /* Dimensionless quantity unit: 1 */ |
#define | RT_SENSOR_UNIT_BPM (11) /* Heart rate unit: bpm */ |
#define | RT_SENSOR_UNIT_MM (12) /* Distance unit: mm */ |
#define | RT_SENSOR_UNIT_MN (13) /* Force unit: mN */ |
#define | RT_SENSOR_UNIT_PPM (14) /* Concentration unit: ppm */ |
#define | RT_SENSOR_UNIT_PPB (15) /* Concentration unit: ppb */ |
#define | RT_SENSOR_UNIT_DMS (16) /* Coordinates unit: DMS */ |
#define | RT_SENSOR_UNIT_DD (17) /* Coordinates unit: DD */ |
#define | RT_SENSOR_UNIT_MGM3 (18) /* Concentration unit: mg/m3 */ |
#define | RT_SENSOR_UNIT_MMHG (19) /* Blood Pressure unit: mmHg */ |
#define | RT_SENSOR_UNIT_MV (20) /* Voltage unit: mV */ |
#define | RT_SENSOR_UNIT_MA (21) /* Current unit: mA */ |
#define | RT_SENSOR_UNIT_MW (22) /* Power unit: mW */ |
#define | RT_SENSOR_INTF_I2C (1 << 0) |
#define | RT_SENSOR_INTF_SPI (1 << 1) |
#define | RT_SENSOR_INTF_UART (1 << 2) |
#define | RT_SENSOR_INTF_ONEWIRE (1 << 3) |
#define | RT_SENSOR_POWER_NONE (0) |
#define | RT_SENSOR_POWER_DOWN (1) /* power down mode */ |
#define | RT_SENSOR_POWER_NORMAL (2) /* normal-power mode */ |
#define | RT_SENSOR_POWER_LOW (3) /* low-power mode */ |
#define | RT_SENSOR_POWER_HIGH (4) /* high-power mode */ |
#define | RT_SENSOR_MODE_NONE (0) |
#define | RT_SENSOR_MODE_POLLING (1) /* One shot only read a data */ |
#define | RT_SENSOR_MODE_INT (2) /* TODO: One shot interrupt only read a data */ |
#define | RT_SENSOR_MODE_FIFO (3) /* TODO: One shot interrupt read all fifo data */ |
#define | RT_SENSOR_CTRL_GET_ID (RT_DEVICE_CTRL_BASE(Sensor) + 0) /* Get device id */ |
#define | RT_SENSOR_CTRL_GET_INFO (RT_DEVICE_CTRL_BASE(Sensor) + 1) /* Get sensor info */ |
#define | RT_SENSOR_CTRL_SET_RANGE (RT_DEVICE_CTRL_BASE(Sensor) + 2) /* Set the measure range of sensor. unit is info of sensor */ |
#define | RT_SENSOR_CTRL_SET_ODR (RT_DEVICE_CTRL_BASE(Sensor) + 3) /* Set output date rate. unit is HZ */ |
#define | RT_SENSOR_CTRL_SET_MODE (RT_DEVICE_CTRL_BASE(Sensor) + 4) /* Set sensor's work mode. ex. RT_SENSOR_MODE_POLLING,RT_SENSOR_MODE_INT */ |
#define | RT_SENSOR_CTRL_SET_POWER (RT_DEVICE_CTRL_BASE(Sensor) + 5) /* Set power mode. args type of sensor power mode. ex. RT_SENSOR_POWER_DOWN,RT_SENSOR_POWER_NORMAL */ |
#define | RT_SENSOR_CTRL_SELF_TEST (RT_DEVICE_CTRL_BASE(Sensor) + 6) /* Take a self test */ |
#define | RT_SENSOR_CTRL_USER_CMD_START 0x100 /* User commands should be greater than 0x100 */ |
类型定义 | |
typedef struct rt_sensor_device * | rt_sensor_t |
函数 | |
int | rt_hw_sensor_register (rt_sensor_t sensor, const char *name, rt_uint32_t flag, void *data) |
#define rt_sensor_get_ts | ( | ) |
#define RT_DEVICE_FLAG_FIFO_RX 0x200 /* Flag to use when the sensor is open by fifo mode */ |
#define RT_SENSOR_MODULE_MAX (3) /* The maximum number of members of a sensor module */ |
#define RT_SENSOR_UNIT_PERMILLAGE (7) /* Relative Humidity unit: permillage */ |
#define RT_SENSOR_MODE_INT (2) /* TODO: One shot interrupt only read a data */ |
#define RT_SENSOR_MODE_FIFO (3) /* TODO: One shot interrupt read all fifo data */ |
#define RT_SENSOR_CTRL_GET_ID (RT_DEVICE_CTRL_BASE(Sensor) + 0) /* Get device id */ |
#define RT_SENSOR_CTRL_GET_INFO (RT_DEVICE_CTRL_BASE(Sensor) + 1) /* Get sensor info */ |
#define RT_SENSOR_CTRL_SET_RANGE (RT_DEVICE_CTRL_BASE(Sensor) + 2) /* Set the measure range of sensor. unit is info of sensor */ |
#define RT_SENSOR_CTRL_SET_ODR (RT_DEVICE_CTRL_BASE(Sensor) + 3) /* Set output date rate. unit is HZ */ |
#define RT_SENSOR_CTRL_SET_MODE (RT_DEVICE_CTRL_BASE(Sensor) + 4) /* Set sensor's work mode. ex. RT_SENSOR_MODE_POLLING,RT_SENSOR_MODE_INT */ |
#define RT_SENSOR_CTRL_SET_POWER (RT_DEVICE_CTRL_BASE(Sensor) + 5) /* Set power mode. args type of sensor power mode. ex. RT_SENSOR_POWER_DOWN,RT_SENSOR_POWER_NORMAL */ |
#define RT_SENSOR_CTRL_SELF_TEST (RT_DEVICE_CTRL_BASE(Sensor) + 6) /* Take a self test */ |
#define RT_SENSOR_CTRL_USER_CMD_START 0x100 /* User commands should be greater than 0x100 */ |
typedef struct rt_sensor_device* rt_sensor_t |
int rt_hw_sensor_register | ( | rt_sensor_t | sensor, |
const char * | name, | ||
rt_uint32_t | flag, | ||
void * | data ) |