Skip to content

Commit 0c0a0f9

Browse files
espHorstgk
authored andcommitted
added doc for protected members
1 parent e04d73b commit 0c0a0f9

File tree

1 file changed

+47
-28
lines changed

1 file changed

+47
-28
lines changed

Adafruit_BME280.h

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ class Adafruit_BME280_Unified : public Adafruit_Sensor
138138
/**************************************************************************/
139139
class Adafruit_BME280 {
140140
public:
141-
/**************************************************************************/
142-
/*!
143-
@brief sampling rates
144-
*/
145-
/**************************************************************************/
141+
/**************************************************************************/
142+
/*!
143+
@brief sampling rates
144+
*/
145+
/**************************************************************************/
146146
enum sensor_sampling {
147147
SAMPLING_NONE = 0b000,
148148
SAMPLING_X1 = 0b001,
@@ -220,9 +220,9 @@ class Adafruit_BME280 {
220220
float seaLevelForAltitude(float altitude, float pressure);
221221

222222

223-
private:
224-
TwoWire *_wire;
225-
void readCoefficients(void);
223+
protected:
224+
TwoWire *_wire; //!< pointer to a TwoWire object
225+
void readCoefficients(void);
226226
bool isReadingCalibration(void);
227227
uint8_t spixfer(uint8_t x);
228228

@@ -234,15 +234,23 @@ class Adafruit_BME280 {
234234
uint16_t read16_LE(byte reg); // little endian
235235
int16_t readS16_LE(byte reg); // little endian
236236

237-
uint8_t _i2caddr;
238-
int32_t _sensorID;
239-
int32_t t_fine;
237+
uint8_t _i2caddr; //!< I2C addr for the TwoWire interface
238+
int32_t _sensorID; //!< ID of the BME Sensor
239+
int32_t t_fine; //!< temperature with high resolution, stored as an attribute as this is used for temperature compensation reading humidity and pressure
240240

241-
int8_t _cs, _mosi, _miso, _sck;
241+
int8_t _cs; //!< for the SPI interface
242+
int8_t _mosi; //!< for the SPI interface
243+
int8_t _miso; //!< for the SPI interface
244+
int8_t _sck; //!< for the SPI interface
242245

243-
bme280_calib_data _bme280_calib;
246+
bme280_calib_data _bme280_calib; //!< here calibration data is stored
244247

245-
// The config register
248+
249+
/**************************************************************************/
250+
/*!
251+
@brief config register
252+
*/
253+
/**************************************************************************/
246254
struct config {
247255
// inactive duration (standby time) in normal mode
248256
// 000 = 0.5 ms
@@ -253,28 +261,33 @@ class Adafruit_BME280 {
253261
// 101 = 1000 ms
254262
// 110 = 10 ms
255263
// 111 = 20 ms
256-
unsigned int t_sb : 3;
264+
unsigned int t_sb : 3; ///< inactive duration (standby time) in normal mode
257265

258266
// filter settings
259267
// 000 = filter off
260268
// 001 = 2x filter
261269
// 010 = 4x filter
262270
// 011 = 8x filter
263271
// 100 and above = 16x filter
264-
unsigned int filter : 3;
272+
unsigned int filter : 3; ///< filter settings
265273

266274
// unused - don't set
267-
unsigned int none : 1;
268-
unsigned int spi3w_en : 1;
275+
unsigned int none : 1; ///< unused - don't set
276+
unsigned int spi3w_en : 1; ///< unused - don't set
269277

278+
/// @return combined config register
270279
unsigned int get() {
271280
return (t_sb << 5) | (filter << 2) | spi3w_en;
272281
}
273282
};
274-
config _configReg;
283+
config _configReg; //!< config register object
275284

276285

277-
// The ctrl_meas register
286+
/**************************************************************************/
287+
/*!
288+
@brief ctrl_meas register
289+
*/
290+
/**************************************************************************/
278291
struct ctrl_meas {
279292
// temperature oversampling
280293
// 000 = skipped
@@ -283,7 +296,7 @@ class Adafruit_BME280 {
283296
// 011 = x4
284297
// 100 = x8
285298
// 101 and above = x16
286-
unsigned int osrs_t : 3;
299+
unsigned int osrs_t : 3; ///< temperature oversampling
287300

288301
// pressure oversampling
289302
// 000 = skipped
@@ -292,24 +305,29 @@ class Adafruit_BME280 {
292305
// 011 = x4
293306
// 100 = x8
294307
// 101 and above = x16
295-
unsigned int osrs_p : 3;
308+
unsigned int osrs_p : 3; ///< pressure oversampling
296309

297310
// device mode
298311
// 00 = sleep
299312
// 01 or 10 = forced
300313
// 11 = normal
301-
unsigned int mode : 2;
314+
unsigned int mode : 2; ///< device mode
302315

316+
/// @return combined ctrl register
303317
unsigned int get() {
304318
return (osrs_t << 5) | (osrs_p << 2) | mode;
305319
}
306320
};
307-
ctrl_meas _measReg;
321+
ctrl_meas _measReg; //!< measurement register object
308322

309323

310-
// The ctrl_hum register
324+
/**************************************************************************/
325+
/*!
326+
@brief ctrl_hum register
327+
*/
328+
/**************************************************************************/
311329
struct ctrl_hum {
312-
// unused - don't set
330+
/// unused - don't set
313331
unsigned int none : 5;
314332

315333
// pressure oversampling
@@ -319,13 +337,14 @@ class Adafruit_BME280 {
319337
// 011 = x4
320338
// 100 = x8
321339
// 101 and above = x16
322-
unsigned int osrs_h : 3;
340+
unsigned int osrs_h : 3; ///< pressure oversampling
323341

342+
/// @return combined ctrl hum register
324343
unsigned int get() {
325344
return (osrs_h);
326345
}
327346
};
328-
ctrl_hum _humReg;
347+
ctrl_hum _humReg; //!< hum register object
329348
};
330349

331350
#endif

0 commit comments

Comments
 (0)