Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Adafruit_NAU7802.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,22 @@ bool Adafruit_NAU7802::setPGACap(bool enable) {
return true;
}

/**************************************************************************/
/*!
@brief Enable or disable optional PGA bypass.
@param enable Use true to enable or false to disable
@return False if any I2C error occurred
*/
/**************************************************************************/
bool Adafruit_NAU7802::setPGABypass(bool enable) {
Adafruit_I2CRegister bypass_reg = Adafruit_I2CRegister(i2c_dev, NAU7802_PGA);
Adafruit_I2CRegisterBits bypass_set =
Adafruit_I2CRegisterBits(&bypass_reg, 1, 4); // # bits, bit_shift
if (!bypass_set.write(enable ? 1 : 0))
return false;
return true;
}

/**************************************************************************/
/*!
@brief Perform the internal calibration procedure
Expand Down
1 change: 1 addition & 0 deletions Adafruit_NAU7802.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class Adafruit_NAU7802 {
bool setRate(NAU7802_SampleRate gain);
NAU7802_SampleRate getRate(void);
bool setPGACap(bool enable);
bool setPGABypass(bool enable);
bool calibrate(NAU7802_Calibration mode);

private:
Expand Down