9 #define _BV(bit) (1 << (bit)) // /< This macro isn't pre-defined on all 13 #define RAK1906_ADDRESS 0x76 14 #define CONCAT_BYTES(msb, lsb) (((uint16_t)msb << 8) | (uint16_t)lsb) // /< 53 #define RAK1906_COEFF_SIZE1 25 // /< First array with coefficients 54 #define RAK1906_COEFF_SIZE2 16 // /< Second array with coefficients 55 #define RAK1906_COEFF_START_ADDRESS1 0x89 // /< start address for 57 #define RAK1906_COEFF_START_ADDRESS2 0xE1 // /< start address for 59 #define RAK1906_HUM_REG_SHIFT_VAL 4 // /< Ambient humidity shift value 60 #define RAK1906_BIT_H1_DATA_MSK 0x0F // /< Mask for humidity 61 #define RAK1906_T2_LSB_REG 1 // /< Register for temperature calibration 62 #define RAK1906_T2_MSB_REG 2 // /< Register for temperature calibration 63 #define RAK1906_T3_REG 3 // /< Register for temperature calibration 64 #define RAK1906_P1_LSB_REG 5 // /< Register for pressure calibration 65 #define RAK1906_P1_MSB_REG 6 // /< Register for pressure calibration 66 #define RAK1906_P2_LSB_REG 7 // /< Register for pressure calibration 67 #define RAK1906_P2_MSB_REG 8 // /< Register for pressure calibration 68 #define RAK1906_P3_REG 9 // /< Register for pressure calibration 69 #define RAK1906_P4_LSB_REG 11 // /< Register for pressure calibration 70 #define RAK1906_P4_MSB_REG 12 // /< Register for pressure calibration 71 #define RAK1906_P5_LSB_REG 13 // /< Register for pressure calibration 72 #define RAK1906_P5_MSB_REG 14 // /< Register for pressure calibration 73 #define RAK1906_P7_REG 15 // /< Register for pressure calibration 74 #define RAK1906_P6_REG 16 // /< Register for pressure calibration 75 #define RAK1906_P8_LSB_REG 19 // /< Register for pressure calibration 76 #define RAK1906_P8_MSB_REG 20 // /< Register for pressure calibration 77 #define RAK1906_P9_LSB_REG 21 // /< Register for pressure calibration 78 #define RAK1906_P9_MSB_REG 22 // /< Register for pressure calibration 79 #define RAK1906_P10_REG 23 // /< Register for pressure calibration 80 #define RAK1906_H2_MSB_REG 0 // /< Register for humidity calibration 81 #define RAK1906_H2_LSB_REG 1 // /< Register for humidity calibration 82 #define RAK1906_H1_LSB_REG 1 // /< Register for humidity calibration 83 #define RAK1906_H1_MSB_REG 2 // /< Register for humidity calibration 84 #define RAK1906_H3_REG 3 // /< Register for humidity calibration 85 #define RAK1906_H4_REG 4 // /< Register for humidity calibration 86 #define RAK1906_H5_REG 5 // /< Register for humidity calibration 87 #define RAK1906_H6_REG 6 // /< Register for humidity calibration 88 #define RAK1906_H7_REG 7 // /< Register for humidity calibration 89 #define RAK1906_T1_LSB_REG 8 // /< Register for gas calibration 90 #define RAK1906_T1_MSB_REG 9 // /< Register for gas calibration 91 #define RAK1906_GH2_LSB_REG 10 // /< Register for gas calibration 92 #define RAK1906_GH2_MSB_REG 11 // /< Register for gas calibration 93 #define RAK1906_GH1_REG 12 // /< Register for gas calibration 94 #define RAK1906_GH3_REG 13 // /< Register for gas calibration 95 #define RAK1906_ADDR_RES_HEAT_RANGE_ADDR 0x02 // /< Register for gas 97 #define RAK1906_RHRANGE_MSK 0x30 // /< Register for gas calibration 98 #define RAK1906_ADDR_RES_HEAT_VAL_ADDR 0x00 // /< Register for gas 100 #define RAK1906_ADDR_RANGE_SW_ERR_ADDR 0x04 // /< Register for gas 102 #define RAK1906_RSERROR_MSK 0xF0 // /< Register for gas calibration 129 #ifdef SUPPORT_RAK1906 184 uint8_t setOversampling(
const uint8_t,
const uint8_t);
185 void waitForReadings()
const;
187 uint8_t setIIRFilter(
const uint8_t iirFilterSetting = UINT8_MAX)
const;
190 uint8_t readByte(
const uint8_t)
const;
191 void getCalibration();
193 bool setGas(uint16_t GasTemp, uint16_t GasMillis)
const;
198 float altitude(
const int32_t press,
const float seaLevel =
200 bool measuring()
const;
201 void triggerMeasurement()
const;
238 template <
typename T>
239 uint8_t &getData(
const uint8_t addr, T &value)
const 241 uint8_t * bytePtr = (uint8_t *)&value;
242 static uint8_t structSize =
sizeof(T);
248 for (uint8_t i = 0; i < structSize; i++)
253 template <
typename T>
254 uint8_t &putData(
const uint8_t addr,
const T &value)
const 256 const uint8_t *bytePtr = (
const uint8_t *)&value;
257 static uint8_t structSize =
sizeof(T);
260 for (uint8_t i = 0; i <
sizeof(T); i++)
269 #endif // end RAK1906_
Definition: rak1906.h:116
Definition: rak1906.h:112
Definition: rak1906.h:113
Definition: rak1906.h:106
int32_t tmpGas
Definition: rak1906.h:175
Definition: rak1906.h:107
uint32_t endTransmission(uint8_t sendStop=true)
Definition: rak1906.h:114
Definition: rak1906.h:120
bool update(void)
This function will trigger the RAK1906 to update the Environment values, after the values are updated...
Definition: rak1906.h:108
RAK1906_Commands
Definition: rak1906.h:21
Definition: rak1906.h:111
virtual int available(void)
Definition: rak1906.h:113
Definition: rak1906.h:125
Definition: rak1906.h:111
Definition: rak1906.h:114
Definition: rak1906.h:122
float temperature(void)
This function will trigger the RAK1906 to return the latest TEMPERATURE value.
float humidity(void)
This function will trigger the RAK1906 to return the latest HUMIDITY value.
float gas(void)
This function will trigger the RAK1906 to return the latest GAS value.
void beginTransmission(uint8_t address)
bool init(void)
This function enabled the RAK1906 sensor and puts the device into standby mode / sleep mode for lowes...
int32_t tmpPressure
Definition: rak1906.h:175
virtual size_t write(uint8_t value)
Definition: rak1906.h:117
int32_t tmpTemperature
Definition: rak1906.h:175
uint8_t requestFrom(uint8_t, uint8_t)
Definition: rak1906.h:113
Definition: rak1906.h:113
Definition: rak1906.h:113
sensorTypes
Definition: rak1906.h:111
#define RAK1906_ADDRESS
Definition: rak1906.h:13
Definition: rak1906.h:118
float pressure(void)
This function will trigger the RAK1906 to return the latest AIR PRESSURE value.
int32_t tmpHumidity
Definition: rak1906.h:175
Definition: rak1906.h:113
Definition: rak1906.h:112
oversamplingTypes
Definition: rak1906.h:115
Definition: rak1906.h:111
Definition: rak1906.h:113
Definition: rak1906.h:119
Definition: rak1906.h:105
RAK1906_ErrorCode
Definition: rak1906.h:104
Definition: rak1906.h:121
iirFilterTypes
Definition: rak1906.h:113