Skip to content

Commit b0367b3

Browse files
committed
clanged it
1 parent 567b6bf commit b0367b3

File tree

2 files changed

+93
-81
lines changed

2 files changed

+93
-81
lines changed

Adafruit_SSD1306.cpp

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,12 @@ Adafruit_SSD1306::~Adafruit_SSD1306(void) {
347347
// SPI transaction/selection must be performed in calling function.
348348
/*!
349349
@brief Write a single byte to the SPI port.
350-
350+
351351
@param d
352-
Data byte to be written.
353-
352+
Data byte to be written.
353+
354354
@return void
355-
@note
355+
@note
356356
*/
357357
inline void Adafruit_SSD1306::SPIwrite(uint8_t d) {
358358
if (spi) {
@@ -376,13 +376,16 @@ inline void Adafruit_SSD1306::SPIwrite(uint8_t d) {
376376
}
377377

378378
/*!
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
379+
@brief Issue single command to SSD1306, using I2C or hard/soft SPI as
380+
needed. Because command calls are often grouped, SPI transaction and
381+
selection must be started/ended in calling function for efficiency. This is a
382+
protected function, not exposed (see ssd1306_command() instead).
383+
384+
@param c
385+
the command character to send to the display.
386+
Refer to ssd1306 data sheet for commands
384387
@return None (void).
385-
@note
388+
@note
386389
*/
387390
void Adafruit_SSD1306::ssd1306_command1(uint8_t c) {
388391
if (wire) { // I2C
@@ -396,17 +399,17 @@ void Adafruit_SSD1306::ssd1306_command1(uint8_t c) {
396399
}
397400
}
398401

399-
400402
/*!
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-
403+
@brief Issue list of commands to SSD1306, same rules as above re:
404+
transactions. This is a protected function, not exposed.
405+
@param c
406+
pointer to list of commands
407+
408+
@param n
409+
number of commands in the list
410+
408411
@return None (void).
409-
@note
412+
@note
410413
*/
411414
void Adafruit_SSD1306::ssd1306_commandList(const uint8_t *c, uint8_t n) {
412415
if (wire) { // I2C
@@ -720,15 +723,17 @@ void Adafruit_SSD1306::drawFastHLine(int16_t x, int16_t y, int16_t w,
720723
}
721724

722725
/*!
723-
@brief Draw a horizontal line with a width and color. Used by public methods 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.
726+
@brief Draw a horizontal line with a width and color. Used by public
727+
methods drawFastHLine,drawFastVLine
728+
@param x
729+
Leftmost column -- 0 at left to (screen width - 1) at right.
730+
@param y
731+
Row of display -- 0 at top to (screen height -1) at bottom.
732+
@param w
733+
Width of line, in pixels.
734+
@param color
735+
Line color, one of: SSD1306_BLACK, SSD1306_WHITE or
736+
SSD1306_INVERT.
732737
@return None (void).
733738
@note Changes buffer contents only, no immediate effect on display.
734739
Follow up with a call to display(), or with other graphics
@@ -818,14 +823,16 @@ void Adafruit_SSD1306::drawFastVLine(int16_t x, int16_t y, int16_t h,
818823
}
819824

820825
/*!
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.
826+
@brief Draw a vertical line with a width and color. Used by public method
827+
drawFastHLine,drawFastVLine
828+
@param x
829+
Leftmost column -- 0 at left to (screen width - 1) at right.
830+
@param __y
831+
Row of display -- 0 at top to (screen height -1) at bottom.
832+
@param __h height of the line in pixels
833+
@param color
834+
Line color, one of: SSD1306_BLACK, SSD1306_WHITE or
835+
SSD1306_INVERT.
829836
@return None (void).
830837
@note Changes buffer contents only, no immediate effect on display.
831838
Follow up with a call to display(), or with other graphics

Adafruit_SSD1306.h

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -60,50 +60,50 @@ typedef uint32_t PortMask;
6060
/// header client code will then need to be modified to use the scoped enum
6161
/// values directly
6262
#ifndef NO_ADAFRUIT_SSD1306_COLOR_COMPATIBILITY
63-
#define BLACK SSD1306_BLACK ///< Draw 'off' pixels
64-
#define WHITE SSD1306_WHITE ///< Draw 'on' pixels
63+
#define BLACK SSD1306_BLACK ///< Draw 'off' pixels
64+
#define WHITE SSD1306_WHITE ///< Draw 'on' pixels
6565
#define INVERSE SSD1306_INVERSE ///< Invert pixels
6666
#endif
6767
/// fit into the SSD1306_ naming scheme
68-
#define SSD1306_BLACK 0 ///< Draw 'off' pixels
69-
#define SSD1306_WHITE 1 ///< Draw 'on' pixels
68+
#define SSD1306_BLACK 0 ///< Draw 'off' pixels
69+
#define SSD1306_WHITE 1 ///< Draw 'on' pixels
7070
#define SSD1306_INVERSE 2 ///< Invert pixels
7171

72-
#define SSD1306_MEMORYMODE 0x20 ///< See datasheet
73-
#define SSD1306_COLUMNADDR 0x21 ///< See datasheet
74-
#define SSD1306_PAGEADDR 0x22 ///< See datasheet
75-
#define SSD1306_SETCONTRAST 0x81 ///< See datasheet
76-
#define SSD1306_CHARGEPUMP 0x8D ///< See datasheet
77-
#define SSD1306_SEGREMAP 0xA0 ///< See datasheet
72+
#define SSD1306_MEMORYMODE 0x20 ///< See datasheet
73+
#define SSD1306_COLUMNADDR 0x21 ///< See datasheet
74+
#define SSD1306_PAGEADDR 0x22 ///< See datasheet
75+
#define SSD1306_SETCONTRAST 0x81 ///< See datasheet
76+
#define SSD1306_CHARGEPUMP 0x8D ///< See datasheet
77+
#define SSD1306_SEGREMAP 0xA0 ///< See datasheet
7878
#define SSD1306_DISPLAYALLON_RESUME 0xA4 ///< See datasheet
79-
#define SSD1306_DISPLAYALLON 0xA5 ///< Not currently used
80-
#define SSD1306_NORMALDISPLAY 0xA6 ///< See datasheet
81-
#define SSD1306_INVERTDISPLAY 0xA7 ///< See datasheet
82-
#define SSD1306_SETMULTIPLEX 0xA8 ///< See datasheet
83-
#define SSD1306_DISPLAYOFF 0xAE ///< See datasheet
84-
#define SSD1306_DISPLAYON 0xAF ///< See datasheet
85-
#define SSD1306_COMSCANINC 0xC0 ///< Not currently used
86-
#define SSD1306_COMSCANDEC 0xC8 ///< See datasheet
87-
#define SSD1306_SETDISPLAYOFFSET 0xD3 ///< See datasheet
88-
#define SSD1306_SETDISPLAYCLOCKDIV 0xD5 ///< See datasheet
89-
#define SSD1306_SETPRECHARGE 0xD9 ///< See datasheet
90-
#define SSD1306_SETCOMPINS 0xDA ///< See datasheet
91-
#define SSD1306_SETVCOMDETECT 0xDB ///< See datasheet
92-
93-
#define SSD1306_SETLOWCOLUMN 0x00 ///< Not currently used
79+
#define SSD1306_DISPLAYALLON 0xA5 ///< Not currently used
80+
#define SSD1306_NORMALDISPLAY 0xA6 ///< See datasheet
81+
#define SSD1306_INVERTDISPLAY 0xA7 ///< See datasheet
82+
#define SSD1306_SETMULTIPLEX 0xA8 ///< See datasheet
83+
#define SSD1306_DISPLAYOFF 0xAE ///< See datasheet
84+
#define SSD1306_DISPLAYON 0xAF ///< See datasheet
85+
#define SSD1306_COMSCANINC 0xC0 ///< Not currently used
86+
#define SSD1306_COMSCANDEC 0xC8 ///< See datasheet
87+
#define SSD1306_SETDISPLAYOFFSET 0xD3 ///< See datasheet
88+
#define SSD1306_SETDISPLAYCLOCKDIV 0xD5 ///< See datasheet
89+
#define SSD1306_SETPRECHARGE 0xD9 ///< See datasheet
90+
#define SSD1306_SETCOMPINS 0xDA ///< See datasheet
91+
#define SSD1306_SETVCOMDETECT 0xDB ///< See datasheet
92+
93+
#define SSD1306_SETLOWCOLUMN 0x00 ///< Not currently used
9494
#define SSD1306_SETHIGHCOLUMN 0x10 ///< Not currently used
95-
#define SSD1306_SETSTARTLINE 0x40 ///< See datasheet
95+
#define SSD1306_SETSTARTLINE 0x40 ///< See datasheet
9696

97-
#define SSD1306_EXTERNALVCC 0x01 ///< External display voltage source
97+
#define SSD1306_EXTERNALVCC 0x01 ///< External display voltage source
9898
#define SSD1306_SWITCHCAPVCC 0x02 ///< Gen. display voltage from 3.3V
9999

100-
#define SSD1306_RIGHT_HORIZONTAL_SCROLL 0x26 ///< Init rt scroll
101-
#define SSD1306_LEFT_HORIZONTAL_SCROLL 0x27 ///< Init left scroll
100+
#define SSD1306_RIGHT_HORIZONTAL_SCROLL 0x26 ///< Init rt scroll
101+
#define SSD1306_LEFT_HORIZONTAL_SCROLL 0x27 ///< Init left scroll
102102
#define SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29 ///< Init diag scroll
103-
#define SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A ///< Init diag scroll
104-
#define SSD1306_DEACTIVATE_SCROLL 0x2E ///< Stop scroll
105-
#define SSD1306_ACTIVATE_SCROLL 0x2F ///< Start scroll
106-
#define SSD1306_SET_VERTICAL_SCROLL_AREA 0xA3 ///< Set scroll range
103+
#define SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A ///< Init diag scroll
104+
#define SSD1306_DEACTIVATE_SCROLL 0x2E ///< Stop scroll
105+
#define SSD1306_ACTIVATE_SCROLL 0x2F ///< Start scroll
106+
#define SSD1306_SET_VERTICAL_SCROLL_AREA 0xA3 ///< Set scroll range
107107

108108
// Deprecated size stuff for backwards compatibility with old sketches
109109
#if defined SSD1306_128_64
@@ -115,7 +115,7 @@ typedef uint32_t PortMask;
115115
#define SSD1306_LCDHEIGHT 32 ///< DEPRECATED: height w/SSD1306_128_32 defined
116116
#endif
117117
#if defined SSD1306_96_16
118-
#define SSD1306_LCDWIDTH 96 ///< DEPRECATED: width w/SSD1306_96_16 defined
118+
#define SSD1306_LCDWIDTH 96 ///< DEPRECATED: width w/SSD1306_96_16 defined
119119
#define SSD1306_LCDHEIGHT 16 ///< DEPRECATED: height w/SSD1306_96_16 defined
120120
#endif
121121

@@ -167,29 +167,34 @@ 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*/
170+
/** protected: initialized during construction when using SPI. See SPI.cpp
171+
* SPI.h*/
171172
SPIClass *spi;
172-
/** protected:initialized during construction when using I2C. See Wire.cpp Wire.h*/
173+
/** protected:initialized during construction when using I2C. See Wire.cpp
174+
* Wire.h*/
173175
TwoWire *wire;
174-
/** protected: data used for display buffer. Allocated when begin method is called.*/
176+
/** protected: data used for display buffer. Allocated when begin method is
177+
* called.*/
175178
uint8_t *buffer;
176-
/** protected: i2c address initialized when begin method is called.*/
179+
/** protected: i2c address initialized when begin method is called.*/
177180
int8_t i2caddr;
178-
/** protected: VCC selection, set by begin method.*/
181+
/** protected: VCC selection, set by begin method.*/
179182
int8_t vccstate;
180-
/** protected: not used*/
183+
/** protected: not used*/
181184
int8_t page_end;
182-
/** protected: (Master Out Slave In) set when using SPI set during construction. */
185+
/** protected: (Master Out Slave In) set when using SPI set during
186+
* construction. */
183187
int8_t mosiPin;
184-
/** protected: (Clock Pin) set when using SPI set during construction. */
188+
/** protected: (Clock Pin) set when using SPI set during construction. */
185189
int8_t clkPin;
186-
/** protected: (Data Pin) set when using SPI set during construction. */
190+
/** protected: (Data Pin) set when using SPI set during construction. */
187191
int8_t dcPin;
188-
/** protected: (Chip Select Pin) set when using SPI set during construction. */
192+
/** protected: (Chip Select Pin) set when using SPI set during construction.
193+
*/
189194
int8_t csPin;
190195
/** protected: Display reset pin assignment. Set during construction. */
191196
int8_t rstPin;
192-
197+
193198
#ifdef HAVE_PORTREG
194199
PortReg *mosiPort, *clkPort, *dcPort, *csPort;
195200
PortMask mosiPinMask, clkPinMask, dcPinMask, csPinMask;

0 commit comments

Comments
 (0)