You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Create and initialize the Display using Wire library
55
+
*
56
+
* Beware for retro-compatibility default values are provided for all parameters see below.
57
+
* Please note that if you don't wan't SD1306Wire to initialize and change frequency speed ot need to
58
+
* ensure -1 value are specified for all 3 parameters. This can be usefull to control TwoWire with multiple
59
+
* device on the same bus.
60
+
*
61
+
* @param _address I2C Display address
62
+
* @param _sda I2C SDA pin number, default to -1 to skip Wire begin call
63
+
* @param _scl I2C SCL pin number, default to -1 (only SDA = -1 is considered to skip Wire begin call)
64
+
* @param g display geometry dafault to generic GEOMETRY_128_64, see OLEDDISPLAY_GEOMETRY definition for other options
65
+
* @param _i2cBus on ESP32 with 2 I2C HW buses, I2C_ONE for 1st Bus, I2C_TWO fot 2nd bus, default I2C_ONE
66
+
* @param _frequency for Frequency by default Let's use ~700khz if ESP8266 is in 160Mhz mode, this will be limited to ~400khz if the ESP8266 in 80Mhz mode
67
+
*/
68
+
SH1106Wire(uint8_t _address, uint8_t _sda, uint8_t _scl, OLEDDISPLAY_GEOMETRY g = GEOMETRY_128_64, HW_I2C _i2cBus = I2C_ONE, int _frequency = 700000) {
Copy file name to clipboardExpand all lines: src/SSD1306Wire.h
+41-19Lines changed: 41 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -39,34 +39,56 @@
39
39
#define_min min
40
40
#define_max max
41
41
#endif
42
+
//--------------------------------------
42
43
43
44
classSSD1306Wire : publicOLEDDisplay {
44
45
private:
45
46
uint8_t _address;
46
47
int _sda;
47
48
int _scl;
48
49
bool _doI2cAutoInit = false;
50
+
TwoWire* _wire = NULL;
51
+
int _frequency;
49
52
50
53
public:
51
-
SSD1306Wire(uint8_t _address, int _sda = -1, int _scl = -1, OLEDDISPLAY_GEOMETRY g = GEOMETRY_128_64) {
54
+
55
+
/**
56
+
* Create and initialize the Display using Wire library
57
+
*
58
+
* Beware for retro-compatibility default values are provided for all parameters see below.
59
+
* Please note that if you don't wan't SD1306Wire to initialize and change frequency speed ot need to
60
+
* ensure -1 value are specified for all 3 parameters. This can be usefull to control TwoWire with multiple
61
+
* device on the same bus.
62
+
*
63
+
* @param _address I2C Display address
64
+
* @param _sda I2C SDA pin number, default to -1 to skip Wire begin call
65
+
* @param _scl I2C SCL pin number, default to -1 (only SDA = -1 is considered to skip Wire begin call)
66
+
* @param g display geometry dafault to generic GEOMETRY_128_64, see OLEDDISPLAY_GEOMETRY definition for other options
67
+
* @param _i2cBus on ESP32 with 2 I2C HW buses, I2C_ONE for 1st Bus, I2C_TWO fot 2nd bus, default I2C_ONE
68
+
* @param _frequency for Frequency by default Let's use ~700khz if ESP8266 is in 160Mhz mode, this will be limited to ~400khz if the ESP8266 in 80Mhz mode
69
+
*/
70
+
SSD1306Wire(uint8_t _address, int _sda = -1, int _scl = -1, OLEDDISPLAY_GEOMETRY g = GEOMETRY_128_64, HW_I2C _i2cBus = I2C_ONE, int _frequency = 700000) {
0 commit comments