Skip to content

Commit 8fbbdc9

Browse files
committed
-adding documentation for protected members
1 parent ae96f6e commit 8fbbdc9

File tree

2 files changed

+79
-8
lines changed

2 files changed

+79
-8
lines changed

Adafruit_SSD1306.cpp

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,15 @@ Adafruit_SSD1306::~Adafruit_SSD1306(void) {
345345

346346
// Issue single byte out SPI, either soft or hardware as appropriate.
347347
// SPI transaction/selection must be performed in calling function.
348+
/*!
349+
@brief Write a single byte to the SPI port.
350+
351+
@param d
352+
Data byte to be written.
353+
354+
@return void
355+
@note
356+
*/
348357
inline void Adafruit_SSD1306::SPIwrite(uint8_t d) {
349358
if (spi) {
350359
(void)spi->transfer(d);
@@ -366,10 +375,15 @@ inline void Adafruit_SSD1306::SPIwrite(uint8_t d) {
366375
}
367376
}
368377

369-
// Issue single command to SSD1306, using I2C or hard/soft SPI as needed.
370-
// Because command calls are often grouped, SPI transaction and selection
371-
// must be started/ended in calling function for efficiency.
372-
// This is a private function, not exposed (see ssd1306_command() instead).
378+
/*!
379+
@brief Issue single command to SSD1306, using I2C or hard/soft SPI as needed. Because command calls are often grouped, SPI transaction and selection must be started/ended in calling function for efficiency. This is a protected function, not exposed (see ssd1306_command() instead).
380+
381+
@param c
382+
the command character to send to the display.
383+
Refer to ssd1306 data sheet for commands
384+
@return None (void).
385+
@note
386+
*/
373387
void Adafruit_SSD1306::ssd1306_command1(uint8_t c) {
374388
if (wire) { // I2C
375389
wire->beginTransmission(i2caddr);
@@ -382,8 +396,18 @@ void Adafruit_SSD1306::ssd1306_command1(uint8_t c) {
382396
}
383397
}
384398

385-
// Issue list of commands to SSD1306, same rules as above re: transactions.
386-
// This is a private function, not exposed.
399+
400+
/*!
401+
@brief Issue list of commands to SSD1306, same rules as above re: transactions. This is a protected function, not exposed.
402+
@param c
403+
pointer to list of commands
404+
405+
@param n
406+
number of commands in the list
407+
408+
@return None (void).
409+
@note
410+
*/
387411
void Adafruit_SSD1306::ssd1306_commandList(const uint8_t *c, uint8_t n) {
388412
if (wire) { // I2C
389413
wire->beginTransmission(i2caddr);
@@ -695,6 +719,21 @@ void Adafruit_SSD1306::drawFastHLine(int16_t x, int16_t y, int16_t w,
695719
drawFastHLineInternal(x, y, w, color);
696720
}
697721

722+
/*!
723+
@brief Draw a horizontal line with a width and color. Used by public methonds drawFastHLine,drawFastVLine
724+
@param x
725+
Leftmost column -- 0 at left to (screen width - 1) at right.
726+
@param y
727+
Row of display -- 0 at top to (screen height -1) at bottom.
728+
@param w
729+
Width of line, in pixels.
730+
@param color
731+
Line color, one of: SSD1306_BLACK, SSD1306_WHITE or SSD1306_INVERT.
732+
@return None (void).
733+
@note Changes buffer contents only, no immediate effect on display.
734+
Follow up with a call to display(), or with other graphics
735+
commands as needed by one's own application.
736+
*/
698737
void Adafruit_SSD1306::drawFastHLineInternal(int16_t x, int16_t y, int16_t w,
699738
uint16_t color) {
700739

@@ -778,6 +817,20 @@ void Adafruit_SSD1306::drawFastVLine(int16_t x, int16_t y, int16_t h,
778817
drawFastVLineInternal(x, y, h, color);
779818
}
780819

820+
/*!
821+
@brief Draw a vertical line with a width and color. Used by public method drawFastHLine,drawFastVLine
822+
@param x
823+
Leftmost column -- 0 at left to (screen width - 1) at right.
824+
@param __y
825+
Row of display -- 0 at top to (screen height -1) at bottom.
826+
@param __h height of the line in pixels
827+
@param color
828+
Line color, one of: SSD1306_BLACK, SSD1306_WHITE or SSD1306_INVERT.
829+
@return None (void).
830+
@note Changes buffer contents only, no immediate effect on display.
831+
Follow up with a call to display(), or with other graphics
832+
commands as needed by one's own application.
833+
*/
781834
void Adafruit_SSD1306::drawFastVLineInternal(int16_t x, int16_t __y,
782835
int16_t __h, uint16_t color) {
783836

Adafruit_SSD1306.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,29 @@ class Adafruit_SSD1306 : public Adafruit_GFX {
167167
void ssd1306_command1(uint8_t c);
168168
void ssd1306_commandList(const uint8_t *c, uint8_t n);
169169

170+
/** protected: initialized during construction when using spi. See SPI.cpp SPI.h*/
170171
SPIClass *spi;
172+
/** protected:initialized during construction when using twi. See Wire.cpp Wire.h*/
171173
TwoWire *wire;
174+
/** protected: data used for display buffer. allocated when begin method is called*/
172175
uint8_t *buffer;
173-
int8_t i2caddr, vccstate, page_end;
174-
int8_t mosiPin, clkPin, dcPin, csPin, rstPin;
176+
/** protected: i2c address initialized when begin is called.*/
177+
int8_t i2caddr;
178+
/** protected: VCC selection, set by begin method*/
179+
int8_t vccstate;
180+
/** protected: not used*/
181+
int8_t page_end;
182+
/** protected: (Master Out Slave In) set when using SPI set during construction. */
183+
int8_t mosiPin;
184+
/** protected: (Clock Pin) set when using SPI set during construction. */
185+
int8_t clkPin;
186+
/** protected: (Data Pin) set when using SPI set during construction. */
187+
int8_t dcPin;
188+
/** protected: (Chip Select Pin) set when using SPI set during construction. */
189+
int8_t csPin;
190+
/** protected: /** protected: Display reset pin. set during construction. */
191+
int8_t rstPin;
192+
175193
#ifdef HAVE_PORTREG
176194
PortReg *mosiPort, *clkPort, *dcPort, *csPort;
177195
PortMask mosiPinMask, clkPinMask, dcPinMask, csPinMask;

0 commit comments

Comments
 (0)