@@ -110,12 +110,24 @@ bool Adafruit_NAU7802::enable(bool flag) {
110110 return pu_ready.read ();
111111}
112112
113+ /* *************************************************************************/
114+ /* !
115+ @brief Whether there is new ADC data to read
116+ @return True when there's new data available
117+ */
118+ /* *************************************************************************/
113119bool Adafruit_NAU7802::available (void ) {
114120 Adafruit_I2CRegisterBits conv_ready =
115121 Adafruit_I2CRegisterBits (_pu_ctrl_reg, 1 , 5 ); // # bits, bit_shift
116122 return conv_ready.read ();
117123}
118124
125+ /* *************************************************************************/
126+ /* !
127+ @brief Read the stored 24-bit ADC output value.
128+ @return Signed integer with ADC output result, extended to a int32_t
129+ */
130+ /* *************************************************************************/
119131int32_t Adafruit_NAU7802::read (void ) {
120132 Adafruit_I2CRegister adc0 =
121133 Adafruit_I2CRegister (i2c_dev, NAU7802_ADCO_B2, 3 , MSBFIRST);
@@ -128,6 +140,12 @@ int32_t Adafruit_NAU7802::read(void) {
128140 return val;
129141}
130142
143+ /* *************************************************************************/
144+ /* !
145+ @brief Perform a soft reset
146+ @return False if there was any I2C comms error
147+ */
148+ /* *************************************************************************/
131149bool Adafruit_NAU7802::reset (void ) {
132150 Adafruit_I2CRegisterBits reg_reset =
133151 Adafruit_I2CRegisterBits (_pu_ctrl_reg, 1 , 0 ); // # bits, bit_shift
@@ -238,7 +256,7 @@ NAU7802_Gain Adafruit_NAU7802::getGain(void) {
238256/* *************************************************************************/
239257/* !
240258 @brief The desired conversion rate setter
241- @param rate The desired rate: NAU7802_RATE_10SPS, NAU7802_RATE_20SPS,
259+ @param rate The desired rate: NAU7802_RATE_10SPS, NAU7802_RATE_20SPS,
242260 NAU7802_RATE_40SPS, NAU7802_RATE_80SPS, or NAU7802_RATE_320SPS
243261 @returns False if any I2C error occured
244262*/
@@ -254,7 +272,7 @@ bool Adafruit_NAU7802::setRate(NAU7802_SampleRate rate) {
254272/* *************************************************************************/
255273/* !
256274 @brief The desired conversion rate getter
257- @returns The rate: NAU7802_RATE_10SPS, NAU7802_RATE_20SPS,
275+ @returns The rate: NAU7802_RATE_10SPS, NAU7802_RATE_20SPS,
258276 NAU7802_RATE_40SPS, NAU7802_RATE_80SPS, or NAU7802_RATE_320SPS
259277*/
260278/* *************************************************************************/
0 commit comments