diff --git a/src/Dps3xx.cpp b/src/Dps3xx.cpp index a043e1f..2823fd1 100644 --- a/src/Dps3xx.cpp +++ b/src/Dps3xx.cpp @@ -188,3 +188,9 @@ int16_t Dps3xx::flushFIFO() { return writeByteBitfield(1U, registers[FIFO_FL]); } + + +int16_t Dps3xx::softReset() +{ + return writeByteBitfield(0x09, registers[SOFT_RST]); +} diff --git a/src/Dps3xx.h b/src/Dps3xx.h index 048775f..9d74645 100644 --- a/src/Dps3xx.h +++ b/src/Dps3xx.h @@ -17,6 +17,7 @@ class Dps3xx : public DpsClass * @return status code */ int16_t setInterruptSources(uint8_t intr_source, uint8_t polarity = 1); + int16_t softReset(); protected: uint8_t m_tempSensor; diff --git a/src/util/dps3xx_config.h b/src/util/dps3xx_config.h index 9dd93b8..e5b061c 100644 --- a/src/util/dps3xx_config.h +++ b/src/util/dps3xx_config.h @@ -1,7 +1,7 @@ #ifndef DPS3xx_CONFIG_H_ #define DPS3xx_CONFIG_H_ -#define DPS3xx_NUM_OF_REGMASKS 16 +#define DPS3xx_NUM_OF_REGMASKS 17 enum Interrupt_source_3xx_e { @@ -28,6 +28,7 @@ namespace dps3xx FIFO_FULL, // FIFO full INT_HL, INT_SEL, // interrupt select + SOFT_RST // soft reset }; const RegMask_t registers[DPS3xx_NUM_OF_REGMASKS] = { @@ -42,6 +43,7 @@ namespace dps3xx {0x0B, 0x02, 1}, // FIFO_FULL {0x09, 0x80, 7}, // INT_HL {0x09, 0x70, 4}, // INT_SEL + {0x0C, 0x09, 0}, // SOFT_RST }; const RegBlock_t coeffBlock = {0x10, 18};