|
|
|
@ -348,16 +348,22 @@ class U8G2 : public Print {
@@ -348,16 +348,22 @@ class U8G2 : public Print {
|
|
|
|
|
u8g2_uint_t getWidth() { return u8g2_GetDisplayWidth(&u8g2); } |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
void u8x8_SetPin_HW_I2C(u8x8_t *u8x8, uint8_t reset, uint8_t clock, uint8_t data) |
|
|
|
|
{ |
|
|
|
|
void u8x8_SetPin_HW_I2C(u8x8_t *u8x8, uint8_t reset, uint8_t clock, |
|
|
|
|
uint8_t data) { |
|
|
|
|
u8x8_SetPin(u8x8, U8X8_PIN_RESET, reset); |
|
|
|
|
u8x8_SetPin(u8x8, U8X8_PIN_I2C_CLOCK, clock); |
|
|
|
|
u8x8_SetPin(u8x8, U8X8_PIN_I2C_DATA, data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class U8G2_SSD1306_128X64_NONAME_F_HW_I2C : public U8G2 { |
|
|
|
|
public: U8G2_SSD1306_128X64_NONAME_F_HW_I2C(const u8g2_cb_t *rotation, uint8_t reset = U8X8_PIN_NONE, uint8_t clock = U8X8_PIN_NONE, uint8_t data = U8X8_PIN_NONE) : U8G2() { |
|
|
|
|
u8g2_Setup_ssd1306_i2c_128x64_noname_f(&u8g2, rotation, u8g2_esp32_i2c_byte_cb, u8g2_esp32_gpio_and_delay_cb); |
|
|
|
|
public: |
|
|
|
|
U8G2_SSD1306_128X64_NONAME_F_HW_I2C(const u8g2_cb_t *rotation, |
|
|
|
|
uint8_t reset = U8X8_PIN_NONE, |
|
|
|
|
uint8_t clock = U8X8_PIN_NONE, |
|
|
|
|
uint8_t data = U8X8_PIN_NONE) |
|
|
|
|
: U8G2() { |
|
|
|
|
u8g2_Setup_ssd1306_i2c_128x64_noname_f( |
|
|
|
|
&u8g2, rotation, u8g2_esp32_i2c_byte_cb, u8g2_esp32_gpio_and_delay_cb); |
|
|
|
|
u8x8_SetPin_HW_I2C(getU8x8(), reset, clock, data); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|