Merge pull request #3738 from luhuadong/develop

[Sensor] Add AMS sensor vendor info
This commit is contained in:
Bernard Xiong 2020-07-04 18:42:14 +08:00 committed by GitHub
commit 7e5373e733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -63,6 +63,7 @@ extern "C" {
#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 */
/* Sensor unit types */
@ -81,6 +82,8 @@ extern "C" {
#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 */
/* Sensor communication interface types */

View File

@ -335,6 +335,9 @@ static void sensor(int argc, char **argv)
case RT_SENSOR_VENDOR_PLANTOWER:
rt_kprintf("vendor :Plantower\n");
break;
case RT_SENSOR_VENDOR_AMS:
rt_kprintf("vendor :AMS\n");
break;
}
rt_kprintf("model :%s\n", info.model);
switch (info.unit)
@ -381,6 +384,12 @@ static void sensor(int argc, char **argv)
case RT_SENSOR_UNIT_MN:
rt_kprintf("unit :mN\n");
break;
case RT_SENSOR_UNIT_PPM:
rt_kprintf("unit :ppm\n");
break;
case RT_SENSOR_UNIT_PPB:
rt_kprintf("unit :ppb\n");
break;
}
rt_kprintf("range_max :%d\n", info.range_max);
rt_kprintf("range_min :%d\n", info.range_min);