drivers/saul: Added pH

- added device class SAUL_SENSE_PH in saul.h
- added stringification SAUL_SENSE_PH in saul_str.c
This commit is contained in:
Igor Knippenberg 2019-02-10 23:02:54 +01:00
parent ead03d4a08
commit 61d0970939
4 changed files with 5 additions and 0 deletions

View File

@ -104,6 +104,7 @@ enum {
SAUL_SENSE_PM = 0x96, /**< sensor: particulate matter */ SAUL_SENSE_PM = 0x96, /**< sensor: particulate matter */
SAUL_SENSE_CAPACITANCE = 0x97, /**< sensor: capacitance */ SAUL_SENSE_CAPACITANCE = 0x97, /**< sensor: capacitance */
SAUL_SENSE_VOLTAGE = 0x98, /**< sensor: voltage */ SAUL_SENSE_VOLTAGE = 0x98, /**< sensor: voltage */
SAUL_SENSE_PH = 0x99, /**< sensor: pH */
SAUL_CLASS_ANY = 0xff /**< any device - wildcard */ SAUL_CLASS_ANY = 0xff /**< any device - wildcard */
/* extend this list as needed... */ /* extend this list as needed... */
}; };

View File

@ -61,6 +61,7 @@ const char *saul_class_to_str(const uint8_t class_id)
case SAUL_SENSE_PM: return "SENSE_PM"; case SAUL_SENSE_PM: return "SENSE_PM";
case SAUL_SENSE_CAPACITANCE: return "SENSE_CAPACITANCE"; case SAUL_SENSE_CAPACITANCE: return "SENSE_CAPACITANCE";
case SAUL_SENSE_VOLTAGE: return "SENSE_VOLTAGE"; case SAUL_SENSE_VOLTAGE: return "SENSE_VOLTAGE";
case SAUL_SENSE_PH: return "SENSE_PH";
case SAUL_CLASS_ANY: return "CLASS_ANY"; case SAUL_CLASS_ANY: return "CLASS_ANY";
default: return "CLASS_UNKNOWN"; default: return "CLASS_UNKNOWN";
} }

View File

@ -97,6 +97,8 @@ enum {
UNIT_DBM, /**< decibel-milliwatts */ UNIT_DBM, /**< decibel-milliwatts */
UNIT_COULOMB, /**< coulomb */ UNIT_COULOMB, /**< coulomb */
UNIT_F, /**< Farad */ UNIT_F, /**< Farad */
/* electrochemical */
UNIT_PH, /**< pH */
/* pressure */ /* pressure */
UNIT_BAR, /**< Beer? */ UNIT_BAR, /**< Beer? */
UNIT_PA, /**< Pascal */ UNIT_PA, /**< Pascal */

View File

@ -104,6 +104,7 @@ const char *phydat_unit_to_str(uint8_t unit)
case UNIT_COULOMB: return "C"; case UNIT_COULOMB: return "C";
case UNIT_GPM3: return "g/m^3"; case UNIT_GPM3: return "g/m^3";
case UNIT_F: return "F"; case UNIT_F: return "F";
case UNIT_PH: return "pH";
default: return ""; default: return "";
} }
} }