CheeseBoard
A library for use with the CheeseBoard Cheddar platform
CbOledDisplay.h
1 #pragma once
2 
3 #include <U8g2lib.h>
4 #include "CheeseboardConfig.h"
5 
6 #ifdef U8X8_HAVE_HW_SPI
7 #include <SPI.h>
8 #endif
9 #ifdef U8X8_HAVE_HW_I2C
10 #include <Wire.h>
11 #endif
12 
17 class CbOledDisplayClass : public CBOLED_CLASS {
18 public:
29  CbOledDisplayClass(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset=U8X8_PIN_NONE);
30 
33  void begin();
34 
40  u8g2_uint_t getCharWidth(char c);
41 
48  u8g2_uint_t drawStrR(u8g2_uint_t x, u8g2_uint_t y, const char *s);
49 
56  void drawText(const char* text, char hAlign='L', char vAlign='M');
57 
61  void clear() { this->clearBuffer(); }
64  void show() { this->sendBuffer(); }
65 
66 };
67 
68 extern CbOledDisplayClass CbOledDisplay;
69 
u8g2_uint_t drawStrR(u8g2_uint_t x, u8g2_uint_t y, const char *s)
u8g2_uint_t getCharWidth(char c)
CbOledDisplayClass(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset=U8X8_PIN_NONE)
void drawText(const char *text, char hAlign='L', char vAlign='M')