Skip to content

Commit 67e1756

Browse files
committed
Doxygen pass
1 parent 166b2b1 commit 67e1756

File tree

3 files changed

+97
-8
lines changed

3 files changed

+97
-8
lines changed

src/components/i2c/controller.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ I2cController::~I2cController() {
403403
@brief Removes an I2C driver from the controller and frees memory
404404
@param address
405405
The desired I2C device's address.
406+
@returns True if the driver was removed, False otherwise.
406407
*/
407408
/***********************************************************************/
408409
bool I2cController::RemoveDriver(uint32_t address) {

src/components/i2c/hardware.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ void I2cHardware::InitBus(bool is_default, const char *sda, const char *scl) {
155155
_bus_status = wippersnapper_i2c_I2cBusStatus_I2C_BUS_STATUS_SUCCESS;
156156
}
157157

158+
/***********************************************************************/
159+
/*!
160+
@brief Clears the MUX channel.
161+
@param scan_results
162+
The I2C bus scan results.
163+
@returns True if the MUX channel was successfully cleared,
164+
False otherwise.
165+
*/
166+
/***********************************************************************/
158167
bool I2cHardware::ScanBus(wippersnapper_i2c_I2cBusScanned *scan_results) {
159168
if (!scan_results)
160169
return false;
@@ -272,6 +281,11 @@ bool I2cHardware::AddMuxToBus(uint32_t address_register, const char *name) {
272281
return true;
273282
}
274283

284+
/***********************************************************************/
285+
/*!
286+
@brief Removes a MUX from the I2C bus.
287+
*/
288+
/***********************************************************************/
275289
void I2cHardware::RemoveMux() {
276290
ClearMuxChannel();
277291
_has_mux = false;
@@ -318,6 +332,14 @@ void I2cHardware::SelectMuxChannel(uint32_t channel) {
318332
/***********************************************************************/
319333
bool I2cHardware::HasMux() { return _has_mux; }
320334

335+
/***********************************************************************/
336+
/*!
337+
@brief Returns the maximum number of channels on the MUX.
338+
@param scan_results
339+
The I2C bus scan results.
340+
@returns The maximum number of channels on the MUX.
341+
*/
342+
/***********************************************************************/
321343
bool I2cHardware::ScanMux(wippersnapper_i2c_I2cBusScanned *scan_results) {
322344
if (!HasMux()) {
323345
WS_DEBUG_PRINTLN("[i2c] ERROR: No MUX present on the bus!");

src/components/pixels/hardware.cpp

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ PixelsHardware::PixelsHardware() {
3131
/**************************************************************************/
3232
PixelsHardware::~PixelsHardware() {}
3333

34+
/**************************************************************************/
35+
/*!
36+
@brief Initializes a new NeoPixel strand on a desired pin.
37+
@param num_pixels
38+
Number of pixels in the strand.
39+
@param pin_data
40+
The desired data pin for the pixel strand.
41+
@param order
42+
The desired color ordering for the pixel strand.
43+
@param brightness
44+
The desired brightness of the pixel strand (0-255).
45+
@returns True if successful, False otherwise.
46+
*/
47+
/**************************************************************************/
3448
bool PixelsHardware::AddNeoPixel(uint16_t num_pixels, uint16_t pin_data,
3549
neoPixelType order, uint8_t brightness) {
3650
if (getStatusNeoPixelPin() == pin_data && WsV2.lockStatusNeoPixelV2)
@@ -50,6 +64,22 @@ bool PixelsHardware::AddNeoPixel(uint16_t num_pixels, uint16_t pin_data,
5064
return true;
5165
}
5266

67+
/**************************************************************************/
68+
/*!
69+
@brief Initializes a new DotStar strand on a desired pin.
70+
@param num_pixels
71+
Number of pixels in the strand.
72+
@param pin_data
73+
The desired data pin for the pixel strand.
74+
@param pin_clock
75+
The desired clock pin for the pixel strand.
76+
@param order
77+
The desired color ordering for the pixel strand.
78+
@param brightness
79+
The desired brightness of the pixel strand (0-255).
80+
@returns True if successful, False otherwise.
81+
*/
82+
/**************************************************************************/
5383
bool PixelsHardware::AddDotStar(uint16_t num_pixels, uint16_t pin_data,
5484
uint16_t pin_clock,
5585
wippersnapper_pixels_PixelsOrder order,
@@ -75,6 +105,24 @@ bool PixelsHardware::AddDotStar(uint16_t num_pixels, uint16_t pin_data,
75105
WS_DEBUG_PRINT(pin_clock);
76106
}
77107

108+
/**************************************************************************/
109+
/*!
110+
@brief Initializes a new pixel strand on a desired pin.
111+
@param type
112+
The desired pixel type (NeoPixel or DotStar).
113+
@param order
114+
The desired color ordering for the pixel strand.
115+
@param num_pixels
116+
Number of pixels in the strand.
117+
@param brightness
118+
The desired brightness of the pixel strand (0-255).
119+
@param pin_data
120+
The desired data pin for the pixel strand.
121+
@param pin_clock
122+
The desired clock pin for the pixel strand (for DotStar).
123+
@returns True if successful, False otherwise.
124+
*/
125+
/**************************************************************************/
78126
bool PixelsHardware::AddStrand(wippersnapper_pixels_PixelsType type,
79127
wippersnapper_pixels_PixelsOrder order,
80128
uint32_t num_pixels, uint32_t brightness,
@@ -105,8 +153,6 @@ bool PixelsHardware::AddStrand(wippersnapper_pixels_PixelsType type,
105153
/**************************************************************************/
106154
/*!
107155
@brief Sets the color of all pixels in the strand
108-
@param pin_data
109-
Data pin for the pixel strand
110156
@param color
111157
32-bit color value
112158
*/
@@ -127,6 +173,14 @@ void PixelsHardware::FillStrand(uint32_t color) {
127173
}
128174
}
129175

176+
/**************************************************************************/
177+
/*!
178+
@brief Applies gamma correction to a color value to match IO Web.
179+
@param color
180+
The color value to be corrected
181+
@returns The gamma-corrected color value
182+
*/
183+
/**************************************************************************/
130184
uint32_t PixelsHardware::ApplyGammaCorrection(uint32_t color) {
131185
if (_type == wippersnapper_pixels_PixelsType_PIXELS_TYPE_NEOPIXEL) {
132186
return _neopixel->gamma32(color);
@@ -141,8 +195,6 @@ uint32_t PixelsHardware::ApplyGammaCorrection(uint32_t color) {
141195
/**************************************************************************/
142196
/*!
143197
@brief Deinitializes a pixel strand
144-
@param pin_data
145-
Data pin for the pixel strand
146198
*/
147199
/**************************************************************************/
148200
void PixelsHardware::RemoveStrand() {
@@ -174,8 +226,15 @@ void PixelsHardware::RemoveStrand() {
174226
/**************************************************************************/
175227
uint16_t PixelsHardware::GetPinData() { return _pin_data; }
176228

177-
neoPixelType
178-
PixelsHardware::GetStrandOrderNeoPixel(wippersnapper_pixels_PixelsOrder order) {
229+
/**************************************************************************/
230+
/*!
231+
@brief Gets the color ordering for NeoPixel strands
232+
@param order
233+
The desired color ordering for the pixel strand.
234+
@returns The color ordering for NeoPixel strands
235+
*/
236+
/**************************************************************************/
237+
neoPixelType PixelsHardware::GetStrandOrderNeoPixel(wippersnapper_pixels_PixelsOrder order) {
179238
switch (order) {
180239
case wippersnapper_pixels_PixelsOrder_PIXELS_ORDER_GRB:
181240
return NEO_GRB + NEO_KHZ800;
@@ -192,8 +251,15 @@ PixelsHardware::GetStrandOrderNeoPixel(wippersnapper_pixels_PixelsOrder order) {
192251
}
193252
}
194253

195-
uint8_t
196-
PixelsHardware::GetStrandOrderDotStar(wippersnapper_pixels_PixelsOrder order) {
254+
/**************************************************************************/
255+
/*!
256+
@brief Gets the color ordering for DotStar strands
257+
@param order
258+
The desired color ordering for the pixel strand.
259+
@returns The color ordering for DotStar strands
260+
*/
261+
/**************************************************************************/
262+
uint8_t PixelsHardware::GetStrandOrderDotStar(wippersnapper_pixels_PixelsOrder order) {
197263
switch (order) {
198264
case wippersnapper_pixels_PixelsOrder_PIXELS_ORDER_GRB:
199265
return DOTSTAR_GRB;

0 commit comments

Comments
 (0)