SparkFun GM-X02B Arduino Library  v1.0.1
An Arduino library for the SparkFun Qwiic MEMS gas sensor breakouts built on the Winsen GM-x02B sensor family
Loading...
Searching...
No Matches
sfDevGMX02B.h
Go to the documentation of this file.
1
40#pragma once
41
42#include <stddef.h>
43#include <stdint.h>
44
45// SparkFun Toolkit core headers
46#include <sfTk/sfTkII2C.h>
47#include <sfTk/sfToolkit.h>
48
50// GM-X02B Sensor Family
52
76
78// Automatic Conversion Cycle Times
80
101
103// Per-Part Descriptor
105
127
129// Family Helpers (usable without an instance)
131
138
144const char *sfe_gmx02b_partName(sfe_gmx02b_sensor_t sensor);
145
151const char *sfe_gmx02b_targetGas(sfe_gmx02b_sensor_t sensor);
152
154// Class Declaration
156
172{
173 public:
187 {
188 // Every getter reads through _part, so it must never be left null.
189 if (!setSensorType(sensor))
191 }
192
201 sfTkError_t begin(sfTkIBus *theBus = nullptr);
202
215 bool isConnected(void);
216
235 bool probeADC(bool assumeUnconfigured = false);
236
237 // ========================= Sensor Identity ============================
238
250
256
261 const sfe_gmx02b_part_t *getPartInfo(void);
262
267 const char *getSensorName(void);
268
273 const char *getTargetGas(void);
274
279 uint8_t getDefaultAddress(void);
280
290 bool rsRisesWithGas(void);
291
296 float getRangeMin_ppm(void);
297
302 float getRangeMax_ppm(void);
303
313 float getRatedSensitivity(void);
314
319 float getRatedConcentration_ppm(void);
320
321 // ========================= Measurement ================================
322
332 sfTkError_t readMeasurement(void);
333
334 // ====================== Cached Measurement Values =====================
335
344 uint16_t getRaw(void);
345
354 float getVoltage_V(void);
355
367 sfTkError_t getSensorResistance_Ohm(float &ohms);
368
380 sfTkError_t getRatio(float &ratio);
381
397 sfTkError_t getGasResponse(float &response);
398
407 bool getAlertTriggered(void);
408
409 // ====================== Board Circuit Parameters ======================
410
420 void setSupplyVoltage_V(float volts);
421
426 float getSupplyVoltage_V(void);
427
436 void setLoadResistance_Ohm(float ohms);
437
442 float getLoadResistance_Ohm(void);
443
453 uint16_t voltageToCounts(float volts);
454
465 float countsToVoltage_V(uint16_t counts);
466
475 uint16_t resistanceToCounts(float ohms);
476
488 sfTkError_t responseToCounts(float response, uint16_t &counts);
489
490 // ====================== Clean-Air Calibration =========================
491
505 sfTkError_t measureCleanAirResistance(float &r0, uint8_t samples = kCleanAirSamples,
506 uint16_t sampleDelayMs = kCleanAirSampleDelayMs);
507
516 void setCleanAirResistance_Ohm(float ohms);
517
522 float getCleanAirResistance_Ohm(void);
523
524 // ====================== Concentration (opt-in) ========================
525
538 void setResponseCurve(float a, float b);
539
549 sfTkError_t getConcentration_ppm(float &ppm);
550
556 bool isInRange(float ppm);
557
558 // ========================== Alert Function ============================
559
575 sfTkError_t setGasAlertResponse(float response);
576
585 sfTkError_t getGasAlert(bool &gasDetected);
586
597 sfTkError_t setAlertLowLimit(uint16_t counts);
598
604 sfTkError_t getAlertLowLimit(uint16_t &counts);
605
616 sfTkError_t setAlertHighLimit(uint16_t counts);
617
623 sfTkError_t getAlertHighLimit(uint16_t &counts);
624
635 sfTkError_t setAlertHysteresis(uint16_t counts);
636
642 sfTkError_t getAlertHysteresis(uint16_t &counts);
643
653 sfTkError_t setAlertHysteresis_mV(float millivolts);
654
660 sfTkError_t getAlertHysteresis_mV(float &millivolts);
661
668 sfTkError_t enableAlertFlag(bool enable);
669
694 sfTkError_t enableAlertPin(bool enable);
695
701 sfTkError_t setAlertPinActiveHigh(bool activeHigh);
702
712 sfTkError_t enableAlertHold(bool enable);
713
723 sfTkError_t getAlertStatus(bool &underRange, bool &overRange);
724
733 sfTkError_t clearAlertStatus(void);
734
735 // ====================== Automatic Conversion Mode =====================
736
749 sfTkError_t setCycleTime(sfe_gmx02b_cycle_time_t cycleTime);
750
756 sfTkError_t getCycleTime(sfe_gmx02b_cycle_time_t &cycleTime);
757
768 sfTkError_t getPeakGasCounts(uint16_t &counts);
769
778 sfTkError_t getPeakGasVoltage_V(float &volts);
779
784 sfTkError_t clearPeakGasCounts(void);
785
795 sfTkError_t getLowestConversion(uint16_t &counts);
796
806 sfTkError_t getHighestConversion(uint16_t &counts);
807
812 sfTkError_t clearLowestConversion(void);
813
818 sfTkError_t clearHighestConversion(void);
819
820 protected:
827 sfTkError_t readRegister8(uint8_t reg, uint8_t &value);
828
835 sfTkError_t writeRegister8(uint8_t reg, uint8_t value);
836
843 sfTkError_t readRegister16(uint8_t reg, uint16_t &value);
844
851 sfTkError_t writeRegister16(uint8_t reg, uint16_t value);
852
859 sfTkError_t readValueRegister(uint8_t reg, uint16_t &counts);
860
867 sfTkError_t writeValueRegister(uint8_t reg, uint16_t counts);
868
875 sfTkError_t updateConfiguration(uint8_t mask, uint8_t value);
876
877 sfTkIBus *_theBus;
878
879 // --- Sensor identity ---
881 const sfe_gmx02b_part_t *_part = nullptr;
882
883 // --- Cached values from the most recent readMeasurement() ---
884 uint16_t _counts = 0;
885 bool _alertFlag = false;
886
887 // --- Board circuit parameters ---
889 float _loadResistance = 0.0f;
890 float _cleanAirResistance = 0.0f;
891
892 // --- Optional user-supplied concentration curve: ppm = a * pow(response, b) ---
893 float _curveA = 0.0f;
894 float _curveB = 0.0f;
895
897 // ADC101C021 Register Pointers
899 static const uint8_t kRegConversionResult = 0x00;
900 static const uint8_t kRegAlertStatus = 0x01;
901 static const uint8_t kRegConfiguration = 0x02;
902 static const uint8_t kRegLowLimit = 0x03;
903 static const uint8_t kRegHighLimit = 0x04;
904 static const uint8_t kRegHysteresis = 0x05;
905 static const uint8_t kRegLowestConversion = 0x06;
906 static const uint8_t kRegHighestConversion = 0x07;
907
909 // Register Bit Definitions
911 // 16-bit value registers carry their 10-bit value in bits 11:2.
912 static const uint8_t kValueShift = 2;
913 static const uint16_t kValueMask = 0x03FF;
914 static const uint16_t kAlertFlagMask = 0x8000;
915
916 // Bits that must read as zero on a value register (below and above the 10-bit field).
917 static const uint16_t kValueReservedMask = 0xF003;
918
919 // Alert status register bits.
920 static const uint8_t kAlertStatusUnderRange = 0x01;
921 static const uint8_t kAlertStatusOverRange = 0x02;
922
923 // Configuration register bits.
924 static const uint8_t kConfigCycleTimeMask = 0xE0;
925 static const uint8_t kConfigCycleTimeShift = 5;
926 static const uint8_t kConfigAlertHold = 0x10;
927 static const uint8_t kConfigAlertFlagEnable = 0x08;
928 static const uint8_t kConfigAlertPinEnable = 0x04;
929 static const uint8_t kConfigReserved = 0x02;
930 static const uint8_t kConfigPolarity = 0x01;
931
933 // Conversion Constants
935 static const uint16_t kAdcFullScale = 1024;
936 static const uint16_t kAdcMaxCounts = 1023;
937 static constexpr float kAdcFullScaleInv = 1.0f / 1024.0f;
938
940 // Board Circuit Defaults
942 static constexpr float kSupplyVoltageDefault = 3.3f;
943
945 // Clean-Air Calibration Defaults
947 static const uint8_t kCleanAirSamples = 16;
948 static const uint16_t kCleanAirSampleDelayMs = 50;
949};
Platform-independent driver for the SparkFun Qwiic MEMS gas sensor breakouts.
Definition sfDevGMX02B.h:172
sfTkError_t getAlertStatus(bool &underRange, bool &overRange)
Read the raw alert status flags.
Definition sfDevGMX02B.cpp:631
static const uint8_t kCleanAirSamples
Default readings averaged for R0.
Definition sfDevGMX02B.h:947
static constexpr float kSupplyVoltageDefault
Qwiic 3.3 V rail powers ADC and sensing loop.
Definition sfDevGMX02B.h:942
float getRatedConcentration_ppm(void)
Get the concentration at which getRatedSensitivity() is specified.
Definition sfDevGMX02B.cpp:299
sfTkError_t readValueRegister(uint8_t reg, uint16_t &counts)
Read a 10-bit value register (value stored in bits 11:2).
Definition sfDevGMX02B.cpp:773
sfTkError_t enableAlertFlag(bool enable)
Enable or disable the alert flag in the conversion result register.
Definition sfDevGMX02B.cpp:611
static const uint8_t kRegLowestConversion
Lowest conversion seen (16-bit).
Definition sfDevGMX02B.h:905
const sfe_gmx02b_part_t * getPartInfo(void)
Get the descriptor for the current sensor variant.
Definition sfDevGMX02B.cpp:259
bool isConnected(void)
Check whether the board's ADC is connected and responding.
Definition sfDevGMX02B.cpp:185
sfTkError_t setAlertHysteresis(uint16_t counts)
Set the alert hysteresis.
Definition sfDevGMX02B.cpp:582
float _loadResistance
Load resistor RL (Ohm). Set from the part descriptor.
Definition sfDevGMX02B.h:889
sfTkError_t getRatio(float &ratio)
Get the raw Rs/R0 ratio from the most recent readMeasurement().
Definition sfDevGMX02B.cpp:348
sfTkError_t getLowestConversion(uint16_t &counts)
Get the lowest conversion result recorded in automatic conversion mode.
Definition sfDevGMX02B.cpp:696
sfTkError_t getAlertLowLimit(uint16_t &counts)
Get the alert low limit.
Definition sfDevGMX02B.cpp:567
const sfe_gmx02b_part_t * _part
Descriptor for _sensorType. Never null after construction.
Definition sfDevGMX02B.h:881
sfTkError_t getAlertHysteresis_mV(float &millivolts)
Get the alert hysteresis as a sensor-output voltage band.
Definition sfDevGMX02B.cpp:598
sfTkError_t clearLowestConversion(void)
Reset the lowest conversion register (to full scale).
Definition sfDevGMX02B.cpp:706
sfTkError_t responseToCounts(float response, uint16_t &counts)
Convert a gas response ratio into the equivalent 10-bit ADC counts.
Definition sfDevGMX02B.cpp:445
static const uint8_t kConfigAlertHold
Alert hold enable (D4).
Definition sfDevGMX02B.h:926
static const uint8_t kConfigPolarity
ALERT pin polarity: 1 = active high (D0).
Definition sfDevGMX02B.h:930
sfDevGMX02B(sfe_gmx02b_sensor_t sensor)
Construct a driver for a specific family member.
Definition sfDevGMX02B.h:186
float getRangeMin_ppm(void)
Get the low end of the part's detection range.
Definition sfDevGMX02B.cpp:284
static const uint8_t kConfigAlertFlagEnable
Conversion result alert flag enable (D3).
Definition sfDevGMX02B.h:927
static const uint8_t kRegHighLimit
Alert high limit (16-bit).
Definition sfDevGMX02B.h:903
void setCleanAirResistance_Ohm(float ohms)
Set the clean-air resistance (R0) directly.
Definition sfDevGMX02B.cpp:494
uint16_t voltageToCounts(float volts)
Convert a voltage into the equivalent 10-bit ADC counts.
Definition sfDevGMX02B.cpp:412
sfTkIBus * _theBus
Pointer to the communication bus device.
Definition sfDevGMX02B.h:877
static const uint8_t kAlertStatusUnderRange
Under-range alert flag.
Definition sfDevGMX02B.h:920
bool getAlertTriggered(void)
Get the ADC alert flag from the most recent readMeasurement().
Definition sfDevGMX02B.cpp:385
sfTkError_t getHighestConversion(uint16_t &counts)
Get the highest conversion result recorded in automatic conversion mode.
Definition sfDevGMX02B.cpp:701
sfTkError_t writeRegister8(uint8_t reg, uint8_t value)
Write an 8-bit register on the ADC.
Definition sfDevGMX02B.cpp:733
sfTkError_t setAlertHighLimit(uint16_t counts)
Set the alert high limit (over-range threshold).
Definition sfDevGMX02B.cpp:572
sfTkError_t getPeakGasVoltage_V(float &volts)
Get the peak gas conversion as a sensor output voltage.
Definition sfDevGMX02B.cpp:678
bool isInRange(float ppm)
Check whether a concentration falls inside the part's rated detection range.
Definition sfDevGMX02B.cpp:530
sfTkError_t readRegister8(uint8_t reg, uint8_t &value)
Read an 8-bit register from the ADC.
Definition sfDevGMX02B.cpp:720
float _curveA
Multiplier; 0 = no curve set.
Definition sfDevGMX02B.h:893
sfTkError_t getAlertHysteresis(uint16_t &counts)
Get the alert hysteresis.
Definition sfDevGMX02B.cpp:587
sfTkError_t clearHighestConversion(void)
Reset the highest conversion register (to zero).
Definition sfDevGMX02B.cpp:712
static const uint8_t kRegLowLimit
Alert low limit (16-bit).
Definition sfDevGMX02B.h:902
sfTkError_t readMeasurement(void)
Read one conversion from the ADC and cache the result.
Definition sfDevGMX02B.cpp:306
float countsToVoltage_V(uint16_t counts)
Convert 10-bit ADC counts into the equivalent sensor output voltage.
Definition sfDevGMX02B.cpp:425
static const uint8_t kConfigAlertPinEnable
ALERT pin enable (D2).
Definition sfDevGMX02B.h:928
sfTkError_t begin(sfTkIBus *theBus=nullptr)
Initialize the device driver with the given bus.
Definition sfDevGMX02B.cpp:171
sfTkError_t writeRegister16(uint8_t reg, uint16_t value)
Write a 16-bit register on the ADC (most significant byte first).
Definition sfDevGMX02B.cpp:763
bool setSensorType(sfe_gmx02b_sensor_t sensor)
Declare which family member is installed.
Definition sfDevGMX02B.cpp:237
sfTkError_t getGasResponse(float &response)
Get the direction-normalized gas response from the most recent readMeasurement().
Definition sfDevGMX02B.cpp:364
uint16_t resistanceToCounts(float ohms)
Convert a sensor resistance into the equivalent 10-bit ADC counts.
Definition sfDevGMX02B.cpp:431
sfTkError_t getGasAlert(bool &gasDetected)
Read the hardware alert status as a single "gas detected" flag.
Definition sfDevGMX02B.cpp:549
void setSupplyVoltage_V(float volts)
Set the sensing circuit supply voltage used by getVoltage_V(), voltageToCounts() and countsToVoltage_...
Definition sfDevGMX02B.cpp:392
float _cleanAirResistance
Stored clean-air sensor resistance R0 (Ohm); 0 = not set.
Definition sfDevGMX02B.h:890
static const uint8_t kRegHighestConversion
Highest conversion seen (16-bit).
Definition sfDevGMX02B.h:906
bool probeADC(bool assumeUnconfigured=false)
Check that the responding device looks like an ADC101C021.
Definition sfDevGMX02B.cpp:192
static const uint16_t kValueMask
Mask for the 10-bit value (after shifting).
Definition sfDevGMX02B.h:913
sfTkError_t setCycleTime(sfe_gmx02b_cycle_time_t cycleTime)
Set the automatic conversion cycle time (enables / disables automatic mode).
Definition sfDevGMX02B.cpp:656
sfTkError_t updateConfiguration(uint8_t mask, uint8_t value)
Read-modify-write bits of the 8-bit configuration register.
Definition sfDevGMX02B.cpp:792
static const uint16_t kAlertFlagMask
Alert flag (D15) in the conversion result.
Definition sfDevGMX02B.h:914
sfTkError_t enableAlertHold(bool enable)
Enable or disable alert hold.
Definition sfDevGMX02B.cpp:626
float getLoadResistance_Ohm(void)
Get the configured load resistance.
Definition sfDevGMX02B.cpp:407
float getRatedSensitivity(void)
Get the datasheet response ratio bound for this part.
Definition sfDevGMX02B.cpp:294
static const uint16_t kCleanAirSampleDelayMs
Default delay between R0 readings (ms).
Definition sfDevGMX02B.h:948
float getCleanAirResistance_Ohm(void)
Get the stored clean-air resistance (R0).
Definition sfDevGMX02B.cpp:499
static constexpr float kAdcFullScaleInv
Precomputed 1 / full scale.
Definition sfDevGMX02B.h:937
static const uint8_t kAlertStatusOverRange
Over-range alert flag.
Definition sfDevGMX02B.h:921
static const uint8_t kConfigReserved
Reserved, reads zero (D1).
Definition sfDevGMX02B.h:929
bool _alertFlag
Alert flag (bit D15) from the conversion result.
Definition sfDevGMX02B.h:885
static const uint8_t kRegAlertStatus
Alert status flags (8-bit).
Definition sfDevGMX02B.h:900
sfTkError_t getConcentration_ppm(float &ppm)
Get the estimated target gas concentration.
Definition sfDevGMX02B.cpp:512
sfTkError_t enableAlertPin(bool enable)
Enable or disable the ADC's ALERT output pin.
Definition sfDevGMX02B.cpp:616
static const uint8_t kRegConfiguration
Configuration (8-bit).
Definition sfDevGMX02B.h:901
void setLoadResistance_Ohm(float ohms)
Override the load resistance (RL) used by getSensorResistance_Ohm().
Definition sfDevGMX02B.cpp:402
static const uint8_t kConfigCycleTimeMask
Cycle time field (D7:5).
Definition sfDevGMX02B.h:924
sfTkError_t setAlertPinActiveHigh(bool activeHigh)
Set the active polarity of the ALERT output pin.
Definition sfDevGMX02B.cpp:621
float getSupplyVoltage_V(void)
Get the configured sensing circuit supply voltage.
Definition sfDevGMX02B.cpp:397
const char * getTargetGas(void)
Get a printable target gas description for the current sensor variant.
Definition sfDevGMX02B.cpp:269
sfTkError_t setAlertLowLimit(uint16_t counts)
Set the alert low limit (under-range threshold).
Definition sfDevGMX02B.cpp:562
static const uint16_t kValueReservedMask
D15:D12 and D1:D0.
Definition sfDevGMX02B.h:917
static const uint16_t kAdcFullScale
10-bit ADC full-scale count (1 LSB = VA / 1024).
Definition sfDevGMX02B.h:935
sfe_gmx02b_sensor_t _sensorType
Declared sensor variant.
Definition sfDevGMX02B.h:880
uint16_t _counts
Raw 10-bit ADC value.
Definition sfDevGMX02B.h:884
sfTkError_t getAlertHighLimit(uint16_t &counts)
Get the alert high limit.
Definition sfDevGMX02B.cpp:577
sfTkError_t readRegister16(uint8_t reg, uint16_t &value)
Read a 16-bit register from the ADC (most significant byte first).
Definition sfDevGMX02B.cpp:743
static const uint8_t kConfigCycleTimeShift
Cycle time field bit position.
Definition sfDevGMX02B.h:925
sfTkError_t clearAlertStatus(void)
Clear both alert status flags.
Definition sfDevGMX02B.cpp:647
sfTkError_t getPeakGasCounts(uint16_t &counts)
Get the peak GAS conversion recorded in automatic conversion mode.
Definition sfDevGMX02B.cpp:672
float getRangeMax_ppm(void)
Get the high end of the part's detection range.
Definition sfDevGMX02B.cpp:289
sfTkError_t getSensorResistance_Ohm(float &ohms)
Get the sensing element resistance (Rs) from the most recent readMeasurement().
Definition sfDevGMX02B.cpp:334
sfTkError_t writeValueRegister(uint8_t reg, uint16_t counts)
Write a 10-bit value register (value stored in bits 11:2).
Definition sfDevGMX02B.cpp:784
sfe_gmx02b_sensor_t getSensorType(void)
Get the declared sensor variant.
Definition sfDevGMX02B.cpp:254
sfTkError_t getCycleTime(sfe_gmx02b_cycle_time_t &cycleTime)
Get the automatic conversion cycle time.
Definition sfDevGMX02B.cpp:661
uint16_t getRaw(void)
Get the raw 10-bit ADC value from the most recent readMeasurement().
Definition sfDevGMX02B.cpp:324
uint8_t getDefaultAddress(void)
Get the factory-default I2C address for the current sensor variant.
Definition sfDevGMX02B.cpp:274
static const uint8_t kValueShift
Bit position of the 10-bit value.
Definition sfDevGMX02B.h:912
const char * getSensorName(void)
Get a printable name for the current sensor variant.
Definition sfDevGMX02B.cpp:264
bool rsRisesWithGas(void)
Report whether Rs rises or falls with target gas concentration.
Definition sfDevGMX02B.cpp:279
sfTkError_t setAlertHysteresis_mV(float millivolts)
Set the alert hysteresis as a sensor-output voltage band.
Definition sfDevGMX02B.cpp:592
static const uint8_t kRegHysteresis
Alert hysteresis (16-bit).
Definition sfDevGMX02B.h:904
sfTkError_t clearPeakGasCounts(void)
Reset the peak gas tracking register for this part.
Definition sfDevGMX02B.cpp:691
static const uint8_t kRegConversionResult
Conversion result (16-bit, read only).
Definition sfDevGMX02B.h:899
float getVoltage_V(void)
Get the sensor output voltage from the most recent readMeasurement().
Definition sfDevGMX02B.cpp:329
float _curveB
Exponent.
Definition sfDevGMX02B.h:894
float _supplyVoltage
ADC reference / sensing loop supply (V).
Definition sfDevGMX02B.h:888
void setResponseCurve(float a, float b)
Set a power-law curve that converts gas response into a concentration.
Definition sfDevGMX02B.cpp:506
static const uint16_t kAdcMaxCounts
Maximum 10-bit ADC value.
Definition sfDevGMX02B.h:936
sfTkError_t setGasAlertResponse(float response)
Set a hardware gas threshold in gas response units.
Definition sfDevGMX02B.cpp:537
sfTkError_t measureCleanAirResistance(float &r0, uint8_t samples=kCleanAirSamples, uint16_t sampleDelayMs=kCleanAirSampleDelayMs)
Measure and store the clean-air sensor resistance (R0).
Definition sfDevGMX02B.cpp:462
sfe_gmx02b_sensor_t
The Winsen GM-x02B sensing elements carried by the SparkFun Qwiic gas sensor boards.
Definition sfDevGMX02B.h:63
@ GM_PART_COUNT
Number of parts in the family. Not a valid sensor.
Definition sfDevGMX02B.h:73
@ GM_302B
GM-302B - alcohol and ethanol vapor.
Definition sfDevGMX02B.h:66
@ GM_102B
GM-102B - nitrogen dioxide (NO2). Rs RISES with gas.
Definition sfDevGMX02B.h:64
@ GM_602B
GM-602B - hydrogen sulfide (H2S) and benzene.
Definition sfDevGMX02B.h:70
@ GM_702B
GM-702B - carbon monoxide (CO) and hydrogen.
Definition sfDevGMX02B.h:71
@ GM_202B
GM-202B - ethanol and smoke.
Definition sfDevGMX02B.h:65
@ GM_402B
GM-402B - methane and propane (combustibles).
Definition sfDevGMX02B.h:67
@ GM_502B
GM-502B - VOCs (ethanol, formaldehyde, toluene).
Definition sfDevGMX02B.h:68
@ GM_512B
GM-512B - breath odor (H2S, ethanol, acetone).
Definition sfDevGMX02B.h:69
@ GM_UNKNOWN
No sensor declared or detected.
Definition sfDevGMX02B.h:74
@ GM_802B
GM-802B - ammonia (NH3).
Definition sfDevGMX02B.h:72
const sfe_gmx02b_part_t * sfe_gmx02b_partInfo(sfe_gmx02b_sensor_t sensor)
Get the descriptor for a family member.
Definition sfDevGMX02B.cpp:103
const char * sfe_gmx02b_partName(sfe_gmx02b_sensor_t sensor)
Get a printable part name.
Definition sfDevGMX02B.cpp:115
sfe_gmx02b_cycle_time_t
Cycle time settings for the ADC101C021's automatic conversion mode.
Definition sfDevGMX02B.h:91
@ GM_CYCLE_TIME_512
Convert every Tconvert x 512 (~1.7 ksps).
Definition sfDevGMX02B.h:97
@ GM_CYCLE_DISABLED
Automatic conversion mode off (normal mode, default).
Definition sfDevGMX02B.h:92
@ GM_CYCLE_TIME_256
Convert every Tconvert x 256 (~3.4 ksps).
Definition sfDevGMX02B.h:96
@ GM_CYCLE_TIME_1024
Convert every Tconvert x 1024 (~0.9 ksps).
Definition sfDevGMX02B.h:98
@ GM_CYCLE_TIME_128
Convert every Tconvert x 128 (~6.7 ksps).
Definition sfDevGMX02B.h:95
@ GM_CYCLE_TIME_2048
Convert every Tconvert x 2048 (~0.4 ksps).
Definition sfDevGMX02B.h:99
@ GM_CYCLE_TIME_64
Convert every Tconvert x 64 (~13.5 ksps).
Definition sfDevGMX02B.h:94
@ GM_CYCLE_TIME_32
Convert every Tconvert x 32 (~27 ksps).
Definition sfDevGMX02B.h:93
const char * sfe_gmx02b_targetGas(sfe_gmx02b_sensor_t sensor)
Get a printable target gas description.
Definition sfDevGMX02B.cpp:142
Per-part parameters for one GM-x02B variant and its board.
Definition sfDevGMX02B.h:116
uint8_t defaultAddress
7-bit I2C address with factory ADR1 / ADR0 jumpers.
Definition sfDevGMX02B.h:117
float ratedSensitivity
Datasheet bound on the response ratio at ratedConcentration.
Definition sfDevGMX02B.h:122
bool rsRisesWithGas
true if Rs increases with target gas (GM-102B only).
Definition sfDevGMX02B.h:118
float rsMax
Datasheet Rs upper bound at the reference concentration (Ohm).
Definition sfDevGMX02B.h:121
float loadResistance
Load resistor RL fitted on this board variant (Ohm).
Definition sfDevGMX02B.h:119
float ratedConcentration
Concentration at which ratedSensitivity is specified (ppm).
Definition sfDevGMX02B.h:123
float rangeMax
High end of the detection range (ppm).
Definition sfDevGMX02B.h:125
float rsMin
Datasheet Rs lower bound at the reference concentration (Ohm).
Definition sfDevGMX02B.h:120
float rangeMin
Low end of the detection range (ppm).
Definition sfDevGMX02B.h:124