RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
sensor.h 文件参考
#include <rtthread.h>
#include "dev_pin.h"
+ sensor.h 的引用(Include)关系图:

浏览该文件的源代码.

结构体

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_devicert_sensor_t
 

函数

int rt_hw_sensor_register (rt_sensor_t sensor, const char *name, rt_uint32_t flag, void *data)
 

宏定义说明

◆ rt_sensor_get_ts

#define rt_sensor_get_ts ( )
值:
rt_tick_get() /* API for the sensor to get the timestamp */
rt_tick_t rt_tick_get(void)
This function will return current tick from operating system startup.
定义 clock.c:69

在文件 sensor.h24 行定义.

◆ RT_PIN_NONE

#define RT_PIN_NONE   0xFFFF /* RT PIN NONE */

在文件 sensor.h27 行定义.

◆ RT_DEVICE_FLAG_FIFO_RX

#define RT_DEVICE_FLAG_FIFO_RX   0x200 /* Flag to use when the sensor is open by fifo mode */

在文件 sensor.h28 行定义.

◆ RT_SENSOR_MODULE_MAX

#define RT_SENSOR_MODULE_MAX   (3) /* The maximum number of members of a sensor module */

在文件 sensor.h30 行定义.

◆ RT_SENSOR_CLASS_NONE

#define RT_SENSOR_CLASS_NONE   (0)

在文件 sensor.h34 行定义.

◆ RT_SENSOR_CLASS_ACCE

#define RT_SENSOR_CLASS_ACCE   (1) /* Accelerometer */

在文件 sensor.h35 行定义.

◆ RT_SENSOR_CLASS_GYRO

#define RT_SENSOR_CLASS_GYRO   (2) /* Gyroscope */

在文件 sensor.h36 行定义.

◆ RT_SENSOR_CLASS_MAG

#define RT_SENSOR_CLASS_MAG   (3) /* Magnetometer */

在文件 sensor.h37 行定义.

◆ RT_SENSOR_CLASS_TEMP

#define RT_SENSOR_CLASS_TEMP   (4) /* Temperature */

在文件 sensor.h38 行定义.

◆ RT_SENSOR_CLASS_HUMI

#define RT_SENSOR_CLASS_HUMI   (5) /* Relative Humidity */

在文件 sensor.h39 行定义.

◆ RT_SENSOR_CLASS_BARO

#define RT_SENSOR_CLASS_BARO   (6) /* Barometer */

在文件 sensor.h40 行定义.

◆ RT_SENSOR_CLASS_LIGHT

#define RT_SENSOR_CLASS_LIGHT   (7) /* Ambient light */

在文件 sensor.h41 行定义.

◆ RT_SENSOR_CLASS_PROXIMITY

#define RT_SENSOR_CLASS_PROXIMITY   (8) /* Proximity */

在文件 sensor.h42 行定义.

◆ RT_SENSOR_CLASS_HR

#define RT_SENSOR_CLASS_HR   (9) /* Heart Rate */

在文件 sensor.h43 行定义.

◆ RT_SENSOR_CLASS_TVOC

#define RT_SENSOR_CLASS_TVOC   (10) /* TVOC Level */

在文件 sensor.h44 行定义.

◆ RT_SENSOR_CLASS_NOISE

#define RT_SENSOR_CLASS_NOISE   (11) /* Noise Loudness */

在文件 sensor.h45 行定义.

◆ RT_SENSOR_CLASS_STEP

#define RT_SENSOR_CLASS_STEP   (12) /* Step sensor */

在文件 sensor.h46 行定义.

◆ RT_SENSOR_CLASS_FORCE

#define RT_SENSOR_CLASS_FORCE   (13) /* Force sensor */

在文件 sensor.h47 行定义.

◆ RT_SENSOR_CLASS_DUST

#define RT_SENSOR_CLASS_DUST   (14) /* Dust sensor */

在文件 sensor.h48 行定义.

◆ RT_SENSOR_CLASS_ECO2

#define RT_SENSOR_CLASS_ECO2   (15) /* eCO2 sensor */

在文件 sensor.h49 行定义.

◆ RT_SENSOR_CLASS_GNSS

#define RT_SENSOR_CLASS_GNSS   (16) /* GPS/GNSS sensor */

在文件 sensor.h50 行定义.

◆ RT_SENSOR_CLASS_TOF

#define RT_SENSOR_CLASS_TOF   (17) /* TOF sensor */

在文件 sensor.h51 行定义.

◆ RT_SENSOR_CLASS_SPO2

#define RT_SENSOR_CLASS_SPO2   (18) /* SpO2 sensor */

在文件 sensor.h52 行定义.

◆ RT_SENSOR_CLASS_IAQ

#define RT_SENSOR_CLASS_IAQ   (19) /* IAQ sensor. */

在文件 sensor.h53 行定义.

◆ RT_SENSOR_CLASS_ETOH

#define RT_SENSOR_CLASS_ETOH   (20) /* EtOH sensor. */

在文件 sensor.h54 行定义.

◆ RT_SENSOR_CLASS_BP

#define RT_SENSOR_CLASS_BP   (21) /* Blood Pressure */

在文件 sensor.h55 行定义.

◆ RT_SENSOR_CLASS_VOLTAGE

#define RT_SENSOR_CLASS_VOLTAGE   (22) /* Voltage sensor */

在文件 sensor.h56 行定义.

◆ RT_SENSOR_CLASS_CURRENT

#define RT_SENSOR_CLASS_CURRENT   (23) /* Current sensor */

在文件 sensor.h57 行定义.

◆ RT_SENSOR_CLASS_POWER

#define RT_SENSOR_CLASS_POWER   (24) /* Power sensor */

在文件 sensor.h58 行定义.

◆ RT_SENSOR_VENDOR_UNKNOWN

#define RT_SENSOR_VENDOR_UNKNOWN   (0)

在文件 sensor.h62 行定义.

◆ RT_SENSOR_VENDOR_STM

#define RT_SENSOR_VENDOR_STM   (1) /* STMicroelectronics */

在文件 sensor.h63 行定义.

◆ RT_SENSOR_VENDOR_BOSCH

#define RT_SENSOR_VENDOR_BOSCH   (2) /* Bosch */

在文件 sensor.h64 行定义.

◆ RT_SENSOR_VENDOR_INVENSENSE

#define RT_SENSOR_VENDOR_INVENSENSE   (3) /* Invensense */

在文件 sensor.h65 行定义.

◆ RT_SENSOR_VENDOR_SEMTECH

#define RT_SENSOR_VENDOR_SEMTECH   (4) /* Semtech */

在文件 sensor.h66 行定义.

◆ RT_SENSOR_VENDOR_GOERTEK

#define RT_SENSOR_VENDOR_GOERTEK   (5) /* Goertek */

在文件 sensor.h67 行定义.

◆ RT_SENSOR_VENDOR_MIRAMEMS

#define RT_SENSOR_VENDOR_MIRAMEMS   (6) /* MiraMEMS */

在文件 sensor.h68 行定义.

◆ RT_SENSOR_VENDOR_DALLAS

#define RT_SENSOR_VENDOR_DALLAS   (7) /* Dallas */

在文件 sensor.h69 行定义.

◆ RT_SENSOR_VENDOR_ASAIR

#define RT_SENSOR_VENDOR_ASAIR   (8) /* Aosong */

在文件 sensor.h70 行定义.

◆ RT_SENSOR_VENDOR_SHARP

#define RT_SENSOR_VENDOR_SHARP   (9) /* Sharp */

在文件 sensor.h71 行定义.

◆ RT_SENSOR_VENDOR_SENSIRION

#define RT_SENSOR_VENDOR_SENSIRION   (10) /* Sensirion */

在文件 sensor.h72 行定义.

◆ RT_SENSOR_VENDOR_TI

#define RT_SENSOR_VENDOR_TI   (11) /* Texas Instruments */

在文件 sensor.h73 行定义.

◆ RT_SENSOR_VENDOR_PLANTOWER

#define RT_SENSOR_VENDOR_PLANTOWER   (12) /* Plantower */

在文件 sensor.h74 行定义.

◆ RT_SENSOR_VENDOR_AMS

#define RT_SENSOR_VENDOR_AMS   (13) /* ams AG */

在文件 sensor.h75 行定义.

◆ RT_SENSOR_VENDOR_MAXIM

#define RT_SENSOR_VENDOR_MAXIM   (14) /* Maxim Integrated */

在文件 sensor.h76 行定义.

◆ RT_SENSOR_VENDOR_MELEXIS

#define RT_SENSOR_VENDOR_MELEXIS   (15) /* Melexis */

在文件 sensor.h77 行定义.

◆ RT_SENSOR_UNIT_NONE

#define RT_SENSOR_UNIT_NONE   (0)

在文件 sensor.h81 行定义.

◆ RT_SENSOR_UNIT_MG

#define RT_SENSOR_UNIT_MG   (1) /* Accelerometer unit: mG */

在文件 sensor.h82 行定义.

◆ RT_SENSOR_UNIT_MDPS

#define RT_SENSOR_UNIT_MDPS   (2) /* Gyroscope unit: mdps */

在文件 sensor.h83 行定义.

◆ RT_SENSOR_UNIT_MGAUSS

#define RT_SENSOR_UNIT_MGAUSS   (3) /* Magnetometer unit: mGauss */

在文件 sensor.h84 行定义.

◆ RT_SENSOR_UNIT_LUX

#define RT_SENSOR_UNIT_LUX   (4) /* Ambient light unit: lux */

在文件 sensor.h85 行定义.

◆ RT_SENSOR_UNIT_CM

#define RT_SENSOR_UNIT_CM   (5) /* Distance unit: cm */

在文件 sensor.h86 行定义.

◆ RT_SENSOR_UNIT_PA

#define RT_SENSOR_UNIT_PA   (6) /* Barometer unit: pa */

在文件 sensor.h87 行定义.

◆ RT_SENSOR_UNIT_PERMILLAGE

#define RT_SENSOR_UNIT_PERMILLAGE   (7) /* Relative Humidity unit: permillage */

在文件 sensor.h88 行定义.

◆ RT_SENSOR_UNIT_DCELSIUS

#define RT_SENSOR_UNIT_DCELSIUS   (8) /* Temperature unit: dCelsius */

在文件 sensor.h89 行定义.

◆ RT_SENSOR_UNIT_HZ

#define RT_SENSOR_UNIT_HZ   (9) /* Frequency unit: HZ */

在文件 sensor.h90 行定义.

◆ RT_SENSOR_UNIT_ONE

#define RT_SENSOR_UNIT_ONE   (10) /* Dimensionless quantity unit: 1 */

在文件 sensor.h91 行定义.

◆ RT_SENSOR_UNIT_BPM

#define RT_SENSOR_UNIT_BPM   (11) /* Heart rate unit: bpm */

在文件 sensor.h92 行定义.

◆ RT_SENSOR_UNIT_MM

#define RT_SENSOR_UNIT_MM   (12) /* Distance unit: mm */

在文件 sensor.h93 行定义.

◆ RT_SENSOR_UNIT_MN

#define RT_SENSOR_UNIT_MN   (13) /* Force unit: mN */

在文件 sensor.h94 行定义.

◆ RT_SENSOR_UNIT_PPM

#define RT_SENSOR_UNIT_PPM   (14) /* Concentration unit: ppm */

在文件 sensor.h95 行定义.

◆ RT_SENSOR_UNIT_PPB

#define RT_SENSOR_UNIT_PPB   (15) /* Concentration unit: ppb */

在文件 sensor.h96 行定义.

◆ RT_SENSOR_UNIT_DMS

#define RT_SENSOR_UNIT_DMS   (16) /* Coordinates unit: DMS */

在文件 sensor.h97 行定义.

◆ RT_SENSOR_UNIT_DD

#define RT_SENSOR_UNIT_DD   (17) /* Coordinates unit: DD */

在文件 sensor.h98 行定义.

◆ RT_SENSOR_UNIT_MGM3

#define RT_SENSOR_UNIT_MGM3   (18) /* Concentration unit: mg/m3 */

在文件 sensor.h99 行定义.

◆ RT_SENSOR_UNIT_MMHG

#define RT_SENSOR_UNIT_MMHG   (19) /* Blood Pressure unit: mmHg */

在文件 sensor.h100 行定义.

◆ RT_SENSOR_UNIT_MV

#define RT_SENSOR_UNIT_MV   (20) /* Voltage unit: mV */

在文件 sensor.h101 行定义.

◆ RT_SENSOR_UNIT_MA

#define RT_SENSOR_UNIT_MA   (21) /* Current unit: mA */

在文件 sensor.h102 行定义.

◆ RT_SENSOR_UNIT_MW

#define RT_SENSOR_UNIT_MW   (22) /* Power unit: mW */

在文件 sensor.h103 行定义.

◆ RT_SENSOR_INTF_I2C

#define RT_SENSOR_INTF_I2C   (1 << 0)

在文件 sensor.h106 行定义.

◆ RT_SENSOR_INTF_SPI

#define RT_SENSOR_INTF_SPI   (1 << 1)

在文件 sensor.h107 行定义.

◆ RT_SENSOR_INTF_UART

#define RT_SENSOR_INTF_UART   (1 << 2)

在文件 sensor.h108 行定义.

◆ RT_SENSOR_INTF_ONEWIRE

#define RT_SENSOR_INTF_ONEWIRE   (1 << 3)

在文件 sensor.h109 行定义.

◆ RT_SENSOR_POWER_NONE

#define RT_SENSOR_POWER_NONE   (0)

在文件 sensor.h113 行定义.

◆ RT_SENSOR_POWER_DOWN

#define RT_SENSOR_POWER_DOWN   (1) /* power down mode */

在文件 sensor.h114 行定义.

◆ RT_SENSOR_POWER_NORMAL

#define RT_SENSOR_POWER_NORMAL   (2) /* normal-power mode */

在文件 sensor.h115 行定义.

◆ RT_SENSOR_POWER_LOW

#define RT_SENSOR_POWER_LOW   (3) /* low-power mode */

在文件 sensor.h116 行定义.

◆ RT_SENSOR_POWER_HIGH

#define RT_SENSOR_POWER_HIGH   (4) /* high-power mode */

在文件 sensor.h117 行定义.

◆ RT_SENSOR_MODE_NONE

#define RT_SENSOR_MODE_NONE   (0)

在文件 sensor.h121 行定义.

◆ RT_SENSOR_MODE_POLLING

#define RT_SENSOR_MODE_POLLING   (1) /* One shot only read a data */

在文件 sensor.h122 行定义.

◆ RT_SENSOR_MODE_INT

#define RT_SENSOR_MODE_INT   (2) /* TODO: One shot interrupt only read a data */

在文件 sensor.h123 行定义.

◆ RT_SENSOR_MODE_FIFO

#define RT_SENSOR_MODE_FIFO   (3) /* TODO: One shot interrupt read all fifo data */

在文件 sensor.h124 行定义.

◆ RT_SENSOR_CTRL_GET_ID

#define RT_SENSOR_CTRL_GET_ID   (RT_DEVICE_CTRL_BASE(Sensor) + 0) /* Get device id */

在文件 sensor.h128 行定义.

◆ RT_SENSOR_CTRL_GET_INFO

#define RT_SENSOR_CTRL_GET_INFO   (RT_DEVICE_CTRL_BASE(Sensor) + 1) /* Get sensor info */

在文件 sensor.h129 行定义.

◆ RT_SENSOR_CTRL_SET_RANGE

#define RT_SENSOR_CTRL_SET_RANGE   (RT_DEVICE_CTRL_BASE(Sensor) + 2) /* Set the measure range of sensor. unit is info of sensor */

在文件 sensor.h130 行定义.

◆ RT_SENSOR_CTRL_SET_ODR

#define RT_SENSOR_CTRL_SET_ODR   (RT_DEVICE_CTRL_BASE(Sensor) + 3) /* Set output date rate. unit is HZ */

在文件 sensor.h131 行定义.

◆ RT_SENSOR_CTRL_SET_MODE

#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 */

在文件 sensor.h132 行定义.

◆ RT_SENSOR_CTRL_SET_POWER

#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 */

在文件 sensor.h133 行定义.

◆ RT_SENSOR_CTRL_SELF_TEST

#define RT_SENSOR_CTRL_SELF_TEST   (RT_DEVICE_CTRL_BASE(Sensor) + 6) /* Take a self test */

在文件 sensor.h134 行定义.

◆ RT_SENSOR_CTRL_USER_CMD_START

#define RT_SENSOR_CTRL_USER_CMD_START   0x100 /* User commands should be greater than 0x100 */

在文件 sensor.h136 行定义.

类型定义说明

◆ rt_sensor_t

typedef struct rt_sensor_device* rt_sensor_t

在文件 sensor.h168 行定义.

函数说明

◆ rt_hw_sensor_register()

int rt_hw_sensor_register ( rt_sensor_t sensor,
const char * name,
rt_uint32_t flag,
void * data )