Skip to content

Commit 8cd12df

Browse files
committed
Doxygen Pass 2/?
1 parent b86d9c2 commit 8cd12df

File tree

6 files changed

+88
-17
lines changed

6 files changed

+88
-17
lines changed

src/Wippersnapper_V2.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
#define WS_DEBUG ///< Define to enable debugging to serial terminal
2525
#define WS_PRINTER Serial ///< Where debug messages will be printed
2626

27-
// Define actual debug output functions when necessary.
27+
/**************************************************************************/
28+
/*!
29+
@brief Debug print macros
30+
*/
31+
/**************************************************************************/
2832
#ifdef WS_DEBUG
2933
#define WS_DEBUG_PRINT(...) \
3034
{ WS_PRINTER.print(__VA_ARGS__); } ///< Prints debug output.

src/adapters/wifi/ws_wifi_esp32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* @file Wippersnapper_ESP32_V2.h
2+
* @file ws_wifi_esp32.h
33
*
44
* This is a driver for using the ESP32's network interface
55
* with Adafruit IO Wippersnapper.

src/components/i2c/controller.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,19 @@
1414
*/
1515
#include "controller.h"
1616

17-
// lambda function to create drvBase driver
17+
/*******************************************************************************/
18+
/*!
19+
@brief lambda function to create a drvBase driver instance
20+
@param i2c
21+
The I2C interface.
22+
@param addr
23+
7-bit device address.
24+
@param mux_channel
25+
The I2C multiplexer channel.
26+
@param driver_name
27+
The name of the driver.
28+
*/
29+
/*******************************************************************************/
1830
using FnCreateI2CDriver =
1931
std::function<drvBase *(TwoWire *, uint16_t, uint32_t, const char *)>;
2032

@@ -329,7 +341,7 @@ static const std::map<std::string, FnCreateI2CDriver> I2cFactory = {
329341
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
330342
const char *driver_name) -> drvBase * {
331343
return new drvVl6180x(i2c, addr, mux_channel, driver_name);
332-
}}};
344+
}}}; ///< I2C driver factory
333345

334346
/***********************************************************************/
335347
/*!

src/components/i2c/drivers/drvBase.h

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class drvBase {
3636
The I2C hardware interface, default is Wire.
3737
@param address
3838
The I2C sensor's unique address.
39+
@param driver_name
40+
The name of the driver.
3941
*/
4042
/*******************************************************************************/
4143
drvBase(TwoWire *i2c, uint16_t address, const char *driver_name) {
@@ -60,6 +62,8 @@ class drvBase {
6062
@param mux_channel
6163
An optional channel number used to address a device on a I2C
6264
MUX.
65+
@param driver_name
66+
The name of the driver.
6367
*/
6468
/*******************************************************************************/
6569
drvBase(TwoWire *i2c, uint16_t address, uint32_t mux_channel,
@@ -98,16 +102,30 @@ class drvBase {
98102
/*******************************************************************************/
99103
uint16_t GetAddress() { return _address; }
100104

105+
/*******************************************************************************/
106+
/*!
107+
@brief Gets the I2C MUX address.
108+
@returns The I2C MUX address.
109+
*/
110+
/*******************************************************************************/
101111
uint32_t GetMuxAddress() { return _i2c_mux_addr; }
102112

113+
/*******************************************************************************/
114+
/*!
115+
@brief Sets the I2C MUX address.
116+
@param mux_address
117+
The I2C MUX address.
118+
*/
119+
/*******************************************************************************/
103120
void SetMuxAddress(uint32_t mux_address) { _i2c_mux_addr = mux_address; }
104121

105122
/*******************************************************************************/
106123
/*!
107124
@brief Set if the I2C driver has an alternative I2C bus.
108-
@param has_alt_i2c_bus
109-
True if the I2C driver requests to use an alternative I2C bus,
110-
False otherwise.
125+
@param scl_pin
126+
The SCL pin for the alternative I2C bus.
127+
@param sda_pin
128+
The SDA pin for the alternative I2C bus.
111129
*/
112130
/*******************************************************************************/
113131
void EnableAltI2CBus(char *scl_pin, char *sda_pin) {
@@ -116,7 +134,20 @@ class drvBase {
116134
_has_alt_i2c_bus = true;
117135
}
118136

137+
/*******************************************************************************/
138+
/*!
139+
@brief Gets the SCL pin for the alternative I2C bus.
140+
@returns The SCL pin for the alternative I2C bus.
141+
*/
142+
/*******************************************************************************/
119143
const char *GetPinSCL() { return _pin_scl; }
144+
145+
/*******************************************************************************/
146+
/*!
147+
@brief Gets the SDA pin for the alternative I2C bus.
148+
@returns The SDA pin for the alternative I2C bus.
149+
*/
150+
/*******************************************************************************/
120151
const char *GetPinSDA() { return _pin_sda; }
121152

122153
/*******************************************************************************/
@@ -147,10 +178,10 @@ class drvBase {
147178
/*******************************************************************************/
148179
/*!
149180
@brief Configures an i2c device's sensors.
150-
@param sensors
181+
@param sensor_types
151182
Pointer to an array of SensorType objects.
152-
@param count
153-
The number of active sensors on the device.
183+
@param sensor_types_count
184+
The number of active sensors to read from the device.
154185
*/
155186
/*******************************************************************************/
156187
void EnableSensorReads(wippersnapper_sensor_SensorType *sensor_types,
@@ -320,6 +351,13 @@ class drvBase {
320351
return false;
321352
}
322353

354+
/*******************************************************************************/
355+
/*!
356+
@brief Base implementation - Selects a MUX channel for use with the
357+
I2C device.
358+
@param channel
359+
The MUX channel to select.
360+
*/
323361
virtual void SelectMUXChannel(uint8_t channel) { return; }
324362

325363
/*******************************************************************************/
@@ -557,6 +595,17 @@ class drvBase {
557595
return false;
558596
}
559597

598+
/*******************************************************************************/
599+
/*!
600+
@brief Reads a sensor's event from the i2c driver.
601+
@param sensor_type
602+
The sensor type to read.
603+
@param sensors_event
604+
Pointer to an Adafruit_Sensor event.
605+
@returns True if the sensor event was obtained successfully, False
606+
otherwise.
607+
*/
608+
/*******************************************************************************/
560609
bool GetSensorEvent(wippersnapper_sensor_SensorType sensor_type,
561610
sensors_event_t *sensors_event) {
562611
auto it = SensorEventHandlers.find(sensor_type);
@@ -565,7 +614,14 @@ class drvBase {
565614
return it->second(sensors_event);
566615
}
567616

568-
// Lambda function type for all GetEventX() function calls
617+
/*******************************************************************************/
618+
/*!
619+
@brief Function type for sensor event handlers
620+
@param sensors_event_t*
621+
Pointer to the sensor event structure to be filled
622+
@returns True if event was successfully read, False otherwise
623+
*/
624+
/*******************************************************************************/
569625
using fnGetEvent = std::function<bool(sensors_event_t *)>;
570626

571627
// Maps SensorType to function calls
@@ -673,7 +729,7 @@ class drvBase {
673729
{wippersnapper_sensor_SensorType_SENSOR_TYPE_TVOC,
674730
[this](sensors_event_t *event) -> bool {
675731
return this->getEventTVOC(event);
676-
}}};
732+
}}}; ///< SensorType to function call map
677733

678734
wippersnapper_sensor_SensorType
679735
_sensors[15]; ///< Sensors attached to the device.

src/components/i2c/drivers/drvBme280.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ class drvBme280 : public drvBase {
3939
7-bit device address.
4040
@param mux_channel
4141
The I2C MUX channel, if applicable.
42-
@param mux_channel
43-
The I2C multiplexer channel.
4442
@param driver_name
4543
The name of the driver.
4644
*/
4745
/*******************************************************************************/
48-
drvBme280(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel, const char* driver_name)
46+
drvBme280(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel,
47+
const char *driver_name)
4948
: drvBase(i2c, sensorAddress, mux_channel, driver_name) {
5049
_i2c = i2c;
5150
_address = sensorAddress;
@@ -72,7 +71,7 @@ class drvBme280 : public drvBase {
7271
// attempt to initialize BME280
7372
if (!_bme->begin(_address, _i2c))
7473
return false;
75-
74+
7675
// Configure sensors
7776
_bme_temp = _bme->getTemperatureSensor();
7877
if (_bme_temp == NULL)

src/components/i2c/drivers/drvScd4x.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* @file WipperSnapper_I2C_Driver_SCD4x.h
2+
* @file drvScd4x.h
33
*
44
* Device driver for the SCD4X CO2, Temperature, and Humidity sensor.
55
*

0 commit comments

Comments
 (0)