Skip to content

Commit bf396e8

Browse files
committed
doxy and clang
1 parent f409ed4 commit bf396e8

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

Adafruit_NAU7802.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
/**************************************************************************/
113119
bool 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+
/**************************************************************************/
119131
int32_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+
/**************************************************************************/
131149
bool 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
/**************************************************************************/

Adafruit_NAU7802.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222
/** Default NAU7802 I2C address. */
2323
#define NAU7802_I2CADDR_DEFAULT 0x2A ///< I2C address
24-
#define NAU7802_PU_CTRL 0x00 ///< Power control register
25-
#define NAU7802_CTRL1 0x01 ///< Control/config register #1
26-
#define NAU7802_CTRL2 0x02 ///< Control/config register #2
27-
#define NAU7802_ADCO_B2 0x12 ///< ADC ouput LSB
28-
#define NAU7802_REVISION_ID 0x1F ///< Chip revision ID
24+
#define NAU7802_PU_CTRL 0x00 ///< Power control register
25+
#define NAU7802_CTRL1 0x01 ///< Control/config register #1
26+
#define NAU7802_CTRL2 0x02 ///< Control/config register #2
27+
#define NAU7802_ADCO_B2 0x12 ///< ADC ouput LSB
28+
#define NAU7802_REVISION_ID 0x1F ///< Chip revision ID
2929

3030
/*! The possible LDO voltages */
3131
typedef enum _ldovoltages {

0 commit comments

Comments
 (0)