Skip to content

Commit

Permalink
Merge pull request #9325 from aabadie/pr/saul/tvoc_ppb
Browse files Browse the repository at this point in the history
drivers/saul :sys/phydat: add definitions for TVOC sensor type and PPB unit
  • Loading branch information
bergzand authored Jun 25, 2018
2 parents 5b6af6d + 25b9031 commit 42c4460
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/include/saul.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ enum {
SAUL_SENSE_COUNT = 0x8d, /**< sensor: pulse counter */
SAUL_SENSE_DISTANCE = 0x8e, /**< sensor: distance */
SAUL_SENSE_CO2 = 0x8f, /**< sensor: CO2 Gas */
SAUL_SENSE_TVOC = 0x90, /**< sensor: TVOC Gas */
SAUL_CLASS_ANY = 0xff /**< any device - wildcard */
/* extend this list as needed... */
};
Expand Down
1 change: 1 addition & 0 deletions drivers/saul/saul_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const char *saul_class_to_str(const uint8_t class_id)
case SAUL_SENSE_COUNT: return "SENSE_PULSE_COUNT";
case SAUL_SENSE_DISTANCE: return "SENSE_DISTANCE";
case SAUL_SENSE_CO2: return "SENSE_CO2";
case SAUL_SENSE_TVOC: return "SENSE_TVOC";
case SAUL_CLASS_ANY: return "CLASS_ANY";
default: return "CLASS_UNKNOWN";
}
Expand Down
1 change: 1 addition & 0 deletions sys/include/phydat.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ enum {
UNIT_PERCENT, /**< out of 100 */
UNIT_PERMILL, /**< out of 1000 */
UNIT_PPM, /**< part per million */
UNIT_PPB, /**< part per billion */
/* aggregate values */
UNIT_TIME, /**< the three dimensions contain sec, min, and hours */
UNIT_DATE /**< the 3 dimensions contain days, months and years */
Expand Down
1 change: 1 addition & 0 deletions sys/phydat/phydat_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const char *phydat_unit_to_str(uint8_t unit)
case UNIT_BAR: return "Bar";
case UNIT_PA: return "Pa";
case UNIT_PPM: return "ppm";
case UNIT_PPB: return "ppb";
case UNIT_CD: return "cd";
case UNIT_PERCENT: return "%";
default: return "";
Expand Down

0 comments on commit 42c4460

Please sign in to comment.