displaylib_1bit_PICO 2.0.0
1-bit colour graphic display library, Rpi PICO RP2040 library
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ERMCH1115 Class Reference

class to drive the ERMCh1115 OLED More...

#include <ch1115.hpp>

Inheritance diagram for ERMCH1115:
Inheritance graph
[legend]
Collaboration diagram for ERMCH1115:
Collaboration graph
[legend]

Public Member Functions

 ERMCH1115 (int16_t width, int16_t height)
 init the OLED class object
 
virtual void drawPixel (int16_t x, int16_t y, uint8_t colour) override
 Draws a Pixel to the screen, overides the graphics library.
 
void OLEDupdate (void)
 updates the OLED i.e. writes buffer to the screen
 
void OLEDclearBuffer (void)
 clears the active shared buffer i.e. does NOT write to the screen
 
void OLEDBufferScreen (int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t *data)
 Draw buffer data to the screen.
 
uint8_t OLEDSetBufferPtr (uint8_t width, uint8_t height, uint8_t *pBuffer, uint16_t sizeOfBuffer)
 sets the buffer pointer to the users screen data buffer
 
void OLEDSPISetup (spi_inst_t *spi, uint32_t spiBaudRate, int8_t cd, int8_t rst, int8_t cs, int8_t sclk, int8_t din)
 begin Method initialise OLED Sets pinmodes and SPI setup
 
void OLEDinit (uint8_t OLEDcontrast)
 Called from OLEDbegin carries out Power on sequence and register init.
 
void OLEDReset (void)
 Resets OLED in a four wire setup called at start.
 
void OLEDFillScreen (uint8_t pixel, uint8_t mircodelay)
 Fill the screen NOT the buffer with a datapattern.
 
void OLEDFillPage (uint8_t page_num, uint8_t pixels, uint8_t delay)
 Fill the chosen page(0-7) with a datapattern.
 
void OLEDBitmap (int16_t x, int16_t y, uint8_t w, uint8_t h, const uint8_t *data)
 Draw a bitmap to the screen.
 
void OLEDEnable (uint8_t on)
 Turns On Display.
 
void OLEDInvert (uint8_t on)
 invert the display
 
void OLEDFlip (uint8_t on)
 Rotates the display vertically, A 180 degree 'flip'.
 
void OLEDContrast (uint8_t contrast)
 Adjusts contrast.
 
void OLEDscroll (uint8_t bits)
 Turns on Horizontal scroll.
 
void OLEDscrollSetup (uint8_t Timeinterval=ERMCH1115_TIME_SET, uint8_t Direction=ERMCH1115_SCROLL_SETUP, uint8_t mode=ERMCH1115_SET_SCROLL_MODE)
 Sets up Horizontal Scroll.
 
void OLEDfadeEffect (uint8_t bits=ERMCH1115_BREATHEFFECT_DATA)
 Turns on fade effect.
 
bool OLEDIssleeping (void)
 getting for _sleep member . is OLED in sleep mode
 
void OLEDPowerDown (void)
 Power down function.
 
- Public Member Functions inherited from displaylib_graphics
 displaylib_graphics (int16_t w, int16_t h)
 init the OLED Graphics class object constructor
 
void drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color)
 draws a line from (x0,y0) to (x1,y1).
 
void drawFastVLine (int16_t x, int16_t y, int16_t h, uint8_t color)
 Draws a vertical line starting at (x,y) with height h.
 
void drawFastHLine (int16_t x, int16_t y, int16_t w, uint8_t color)
 Draws a horizontal line starting at (x,y) with width w.
 
void drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color)
 draws rectangle at (x,y) where h is height and w is width of the rectangle.
 
void fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint8_t color)
 fills a rectangle starting from coordinates (x,y) with width of w and height of h.
 
void fillScreen (uint8_t color)
 Fills the whole screen with a given color.
 
void drawCircle (int16_t x0, int16_t y0, int16_t r, uint8_t color)
 Draws a circle with center coordinates (centerX, centerY) and a given radius.
 
void fillCircle (int16_t x0, int16_t y0, int16_t r, uint8_t color)
 fills a circle where (x0,y0) are center coordinates an r is circle radius.
 
void drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color)
 draws a triangle of coordinates (x0,y0), (x1,y1) and (x2,y2).
 
void fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color)
 Fills a triangle defined by the coordinates (x0, y0), (x1, y1), and (x2, y2).
 
void drawRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint8_t color)
 draws a rectangle with rounded edges
 
void fillRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint8_t color)
 Fills a rectangle with rounded edges.
 
void setCursor (int16_t x, int16_t y)
 set the cursor position
 
virtual size_t write (uint8_t)
 write method used in the print class when user calls print
 
DisplayRet::Ret_Codes_e writeChar (int16_t x, int16_t y, char value)
 Write 1 character on OLED.
 
DisplayRet::Ret_Codes_e writeCharString (int16_t x, int16_t y, char *text)
 Write Text character array on OLED.
 
void setTextWrap (bool w)
 turn on or off screen _textwrap of the text (fonts 1-6)
 
void setDrawBitmapAddr (bool mode)
 sets the data addressing mode in drawBitmap function.
 
DisplayRet::Ret_Codes_e drawBitmap (int16_t x, int16_t y, std::span< const uint8_t > bitmap, int16_t w, int16_t h, uint8_t color, uint8_t bg)
 Draw a 1-bit color bitmap.
 
int16_t height (void) const
 Gets the height of the display (per current _rotation)
 
int16_t width (void) const
 Gets the width of the display (per current _rotation)
 
display_rotate_e getRotation (void)
 Gets the _rotation of the display.
 
void setRotation (display_rotate_e r)
 Sets the _rotation of the display.
 
void drawLineAngle (int16_t x, int16_t y, int angle, uint8_t start, uint8_t length, int offset, uint8_t color)
 Draws a line using an angle and length as parameters. This function draws a line starting from (x, y), extending in the direction specified by angle, with a given length. The function also allows applying an offset to the angle before computing the line’s end coordinates.
 
void drawQuadrilateral (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t x3, int16_t y3, uint8_t color)
 Draws a quadrilateral (four-sided polygon) by connecting four points with lines. This function draws a quadrilateral by drawing four lines between the given vertices. The lines are drawn in the order: (x0, y0) to (x1, y1), (x1, y1) to (x2, y2), (x2, y2) to (x3, y3), and finally (x3, y3) back to (x0, y0).
 
void fillQuadrilateral (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t x3, int16_t y3, uint8_t color)
 Fills a quadrilateral with the specified color using triangles. This function fills a quadrilateral by dividing it into triangles and filling them individually. The quadrilateral is filled by calling the fillTriangle function three times with appropriate vertex coordinates. The useTriangleSplit parameter determines whether the quadrilateral is divided into two triangles or if only one triangle is used.
 
DisplayRet::Ret_Codes_e drawPolygon (int16_t x, int16_t y, uint8_t sides, int16_t diameter, float rotation, bool fill, uint8_t color)
 Draws a polygon with a specified number of sides, diameter, rotation, and color. This function draws a regular polygon by connecting points equally spaced around a circle, with each point having a distance defined by the diameter. The polygon is rotated by the given angle (in degrees) before being drawn. The number of sides is enforced to be at least 3.
 
void drawArc (uint16_t cx, uint16_t cy, uint16_t radius, uint16_t thickness, float startAngle, float endAngle, uint8_t color)
 Draw an arc on the TFT display. This function draws an arc between two angles (start and end) on a circle with a given radius.
 
void drawSimpleArc (int16_t cx, int16_t cy, int16_t radius, float startAngle, float endAngle, uint8_t color)
 Draw a simple arc of one pixel on the display( no offsets , thickness or maximum arc calculations) This function draws an arc between two angles (start and end) on a circle with a given radius.
 
void drawEllipse (int16_t cx, int16_t cy, int16_t semiMajorAxis, int16_t semiMinorAxis, bool fill, uint8_t color)
 Draw an ellipse on the display. This function uses the midpoint ellipse algorithm to efficiently draw an ellipse centered at (cx, cy) with the given semi-major (horizontal) and semi-minor (vertical) axes.
 
DisplayRet::Ret_Codes_e drawDotGrid (int16_t x, int16_t y, int16_t w, int16_t h, uint8_t DotGridGap, uint8_t color)
 Draws a grid of dots on the screen starting from the given coordinates. This function draws a grid of pixels with a specified gap between them. It checks that the provided coordinates and dimensions are within the screen bounds and adjusts them if necessary. It also validates The grid of dots gap value and defaults it to 2 if invalid.
 
float getArcAngleMax () const
 Get the current maximum angle of the arc.
 
void setArcAngleMax (float arcAngleMax)
 Set a new maximum angle for the arc.
 
int getArcAngleOffset () const
 Get the current angle offset.
 
void setArcAngleOffset (int arcAngleOffset)
 Set a new angle offset.
 
- Public Member Functions inherited from displaylib_fonts
 displaylib_fonts ()
 init the OLED font class object constructor
 
DisplayRet::Ret_Codes_e setFont (std::span< const uint8_t > font)
 SSD1306_SetFont.
 
void setInvertFont (bool invertStatus)
 setInvertFont
 
bool getInvertFont (void)
 getInvertFont
 
- Public Member Functions inherited from Print
int getWriteError ()
 gets the error flag status, zero no error
 
void clearWriteError ()
 clears the errof flag by setting it to zero
 
size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
size_t write (const char *buffer, size_t size)
 
virtual int availableForWrite ()
 
size_t print (const char[])
 
size_t print (char)
 
size_t print (int, int=DEC)
 
size_t print (unsigned int, int=DEC)
 
size_t print (long, int=DEC)
 
size_t print (unsigned long, int=DEC)
 
size_t print (double, int=2)
 
size_t print (const std::string &)
 
size_t println (const char[])
 
size_t println (char)
 
size_t println (int, int=DEC)
 
size_t println (unsigned int, int=DEC)
 
size_t println (long, int=DEC)
 
size_t println (unsigned long, int=DEC)
 
size_t println (double, int=2)
 
size_t println (void)
 
size_t println (const std::string &s)
 

Private Member Functions

void send_data (uint8_t data)
 Send data byte with SPI to ERMCH1115.
 
void send_command (uint8_t command, uint8_t value)
 Sends a command to the display.
 

Private Attributes

int8_t _display_CS
 
int8_t _display_CD
 
int8_t _display_RST
 
int8_t _display_SCLK
 
int8_t _display_DIN
 
bool _sleep = true
 
uint8_t _OLEDcontrast
 
spi_inst_t * spiInterface
 
int16_t _OLED_WIDTH = 128
 
int16_t _OLED_HEIGHT = 64
 
int8_t _OLED_PAGE_NUM = (_OLED_HEIGHT / 8)
 
uint8_t * _OLEDbuffer = nullptr
 

Static Private Attributes

static constexpr uint8_t ERMCH1115_ENTIRE_DISPLAY_ON = 0xA4
 
static constexpr uint8_t ERMCH1115_ENTIRE_DISPLAY_OFF = 0xA5
 
static constexpr uint8_t ERMCH1115_DISPLAY_ON = 0xAF
 
static constexpr uint8_t ERMCH1115_DISPLAY_OFF = 0xAE
 
static constexpr uint8_t ERMCH1115_DISPLAY_NORMAL = 0xA6
 
static constexpr uint8_t ERMCH1115_DISPLAY_INVERT = 0xA7
 
static constexpr uint8_t ERMCH1115_CONTRAST_CONTROL = 0x81
 
static constexpr uint8_t ERMCH1115_CONTRAST_DATA_DEFAULT = 0x80
 
static constexpr uint8_t ERMCH1115_SET_PAGEADD = 0xB0
 
static constexpr uint8_t ERMCH1115_SET_COLADD_LSB = 0x00
 
static constexpr uint8_t ERMCH1115_SET_COLADD_MSB = 0x10
 
static constexpr uint8_t ERMCH1115_SET_DISPLAY_START_LINE = 0x40
 
static constexpr uint8_t ERMCH1115_SET_PUMP_REG = 0x30
 
static constexpr uint8_t ERMCH1115_SET_PUMP_SET = 0x01
 
static constexpr uint8_t ERMCH1115_IREF_REG = 0x82
 
static constexpr uint8_t ERMCH1115_IREF_SET = 0x00
 
static constexpr uint8_t ERMCH1115_SEG_SET_REMAP = 0xA0
 
static constexpr uint8_t ERMCH1115_SEG_SET_PADS = 0xA2
 
static constexpr uint8_t ERMCH1115_MULTIPLEX_MODE_SET = 0xA8
 
static constexpr uint8_t ERMCH1115_MULTIPLEX_DATA_SET = 0x3F
 
static constexpr uint8_t ERMCH1115_DC_MODE_SET = 0xAD
 
static constexpr uint8_t ERMCH1115_DC_ONOFF_SET = 0x8B
 
static constexpr uint8_t ERMCH1115_COMMON_SCAN_DIR = 0xC0
 
static constexpr uint8_t ERMCH1115_OFFSET_MODE_SET = 0xD3
 
static constexpr uint8_t ERMCH1115_OFFSET_DATA_SET = 0x00
 
static constexpr uint8_t ERMCH1115_BREATHEFFECT_SET = 0x23
 
static constexpr uint8_t ERMCH1115_BREATHEFFECT_DATA = 0x81
 
static constexpr uint8_t ERMCH1115_OSC_FREQ_MODE_SET = 0xD5
 
static constexpr uint8_t ERMCH1115_OSC_FREQ_DATA_SET = 0xA0
 
static constexpr uint8_t ERMCH1115_PRECHARGE_MODE_SET = 0xD9
 
static constexpr uint8_t ERMCH1115_PRECHARGE_DATA_SET = 0x22
 
static constexpr uint8_t ERMCH1115_COM_LEVEL_MODE_SET = 0xDB
 
static constexpr uint8_t ERMCH1115_COM_LEVEL_DATA_SET = 0x40
 
static constexpr uint8_t ERMCH1115_HORIZONTAL_A_SCROLL_SETUP = 0x24
 
static constexpr uint8_t ERMCH1115_HORIZONTAL_A_SCROLL_SET_SCOL = 0x00
 
static constexpr uint8_t ERMCH1115_HORIZONTAL_A_SCROLL_SET_ECOL = 0x7F
 
static constexpr uint8_t ERMCH1115_SCROLL_SETUP = 0x26
 
static constexpr uint8_t ERMCH1115_SPAGE_ADR_SET = 0x00
 
static constexpr uint8_t ERMCH1115_TIME_SET = 0x00
 
static constexpr uint8_t ERMCH1115_EPAGE_ADR_SET = 0x07
 
static constexpr uint8_t ERMCH1115_SET_SCROLL_MODE = 0x28
 
static constexpr uint8_t ERMCH1115_DEACTIVATE_SCROLL = 0x2E
 
static constexpr uint8_t ERMCH1115_ACTIVATE_SCROLL = 0x2F
 

Additional Inherited Members

- Public Types inherited from displaylib_graphics
enum  PixelColor : uint8_t { BG_COLOR = 0 , FG_COLOR = 1 , INVERSE = 2 }
 Display Pixel colours definition. More...
 
enum  display_rotate_e : uint8_t { rDegrees_0 = 0 , rDegrees_90 = 1 , rDegrees_180 = 2 , rDegrees_270 = 3 }
 
- Public Types inherited from Print
enum  BaseNum : uint8_t { DEC = 10 , HEX = 16 , OCT = 8 , BIN = 2 }
 
- Protected Member Functions inherited from displaylib_graphics
float sineFromDegrees (float angle)
 Computes the sine of an angle given in degrees. This function converts the input angle from degrees to radians and then calculates the sine of that angle using the standard C++ sin function.
 
float cosineFromDegrees (float angle)
 Computes the cosine of an angle given in degrees. This function converts the input angle from degrees to radians and then calculates the cosine of that angle using the standard C++ cos function.
 
void ellipseHelper (uint16_t cx, uint16_t cy, uint16_t x, uint16_t y, uint8_t color)
 
void drawArcHelper (uint16_t cx, uint16_t cy, uint16_t radius, uint16_t thickness, float start, float end, uint8_t color)
 
void drawCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint8_t color)
 
void fillCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint8_t color)
 
- Protected Member Functions inherited from Print
void setWriteError (int err=1)
 
- Protected Attributes inherited from displaylib_graphics
const int16_t WIDTH
 
const int16_t HEIGHT
 
display_rotate_e _display_rotate = rDegrees_0
 
int16_t _width
 
int16_t _height
 
int16_t _cursor_x = 0
 
int16_t _cursor_y = 0
 
bool _drawBitmapAddr
 
bool _textwrap = true
 
float _arcAngleMax = 360.0f
 
int _arcAngleOffset = 0
 
- Protected Attributes inherited from displaylib_fonts
std::span< const uint8_t > _FontSelect = pFontDefault
 
uint8_t _Font_X_Size = 0x06
 
uint8_t _Font_Y_Size = 0x08
 
uint8_t _FontOffset = 0x00
 
uint8_t _FontNumChars = 0xFE
 

Detailed Description

class to drive the ERMCh1115 OLED

Constructor & Destructor Documentation

◆ ERMCH1115()

ERMCH1115::ERMCH1115 ( int16_t  oledwidth,
int16_t  oledheight 
)

init the OLED class object

Parameters
oledwidthwidth of oled in pixels
oledheightheight of oled in pixels

Member Function Documentation

◆ drawPixel()

void ERMCH1115::drawPixel ( int16_t  x,
int16_t  y,
uint8_t  colour 
)
overridevirtual

Draws a Pixel to the screen, overides the graphics library.

Parameters
xx co-ord of pixel
yy co-ord of pixel
colourcolour of pixel
Note
virtual function overides the graphics library

Implements displaylib_graphics.

◆ OLEDBitmap()

void ERMCH1115::OLEDBitmap ( int16_t  x,
int16_t  y,
uint8_t  w,
uint8_t  h,
const uint8_t *  data 
)

Draw a bitmap to the screen.

Parameters
xoffset 0-128
yoffset 0-64
wwidth 0-128
hheight 0-64
datapointer to the bitmap
Note
data is const. writes direct to screen , no buffer.

◆ OLEDBufferScreen()

void ERMCH1115::OLEDBufferScreen ( int16_t  x,
int16_t  y,
uint8_t  w,
uint8_t  h,
uint8_t *  data 
)

Draw buffer data to the screen.

Parameters
xoffset 0-128
yoffset 0-64
wwidth 0-128
hheight 0-64
datapointer to the data array
Note
Called by OLEDupdate, used internally mostly

◆ OLEDContrast()

void ERMCH1115::OLEDContrast ( uint8_t  contrast)

Adjusts contrast.

Parameters
contrast0x00 to 0xFF , default 0x80

◆ OLEDEnable()

void ERMCH1115::OLEDEnable ( uint8_t  bits)

Turns On Display.

Parameters
bits1 display on , 0 display off

◆ OLEDfadeEffect()

void ERMCH1115::OLEDfadeEffect ( uint8_t  bits = ERMCH1115_BREATHEFFECT_DATA)

Turns on fade effect.

Parameters
bits0x00 to stop
Note
bits values: (see datasheet breatheffect P25 for more details)
  1. ON/OFF * * A4 A3 A2 A1 A0
  2. When ON/OFF =”H”, Breathing Light ON.
  3. Breathing Display Effect Maximum Brightness Adjust Set: (A4 – A3)
  4. Breathing Display Effect Time Interval Set: (A2 – A0)
  5. Default on is 0x81

◆ OLEDFillPage()

void ERMCH1115::OLEDFillPage ( uint8_t  pageNum,
uint8_t  dataPattern,
uint8_t  mydelay 
)

Fill the chosen page(0-7) with a datapattern.

Parameters
pageNumpage 0-7 divides 64 pixel screen into 8 pages or blocks 64/8
dataPatterncan be set to 0 to FF (not buffer)
mydelayoptional delay in milliseconds can be set to zero normally.

◆ OLEDFillScreen()

void ERMCH1115::OLEDFillScreen ( uint8_t  dataPattern,
uint8_t  delay 
)

Fill the screen NOT the buffer with a datapattern.

Parameters
dataPatterncan be set to zero to clear screen (not buffer) range 0x00 to 0ff
delayA delay in milliseconds can be set to zero normally.

◆ OLEDFlip()

void ERMCH1115::OLEDFlip ( uint8_t  bits)

Rotates the display vertically, A 180 degree 'flip'.

Parameters
bits1 on , 0 off

◆ OLEDinit()

void ERMCH1115::OLEDinit ( uint8_t  OLEDcontrast = ERMCH1115_CONTRAST_DATA_DEFAULT)

Called from OLEDbegin carries out Power on sequence and register init.

Parameters
OLEDcontrastContrast of the OLED display default = 0x80 , range 0x00 to 0xFE

< Init delay mS

◆ OLEDInvert()

void ERMCH1115::OLEDInvert ( uint8_t  bits)

invert the display

Parameters
bits1 invert , 0 normal

◆ OLEDIssleeping()

bool ERMCH1115::OLEDIssleeping ( void  )

getting for _sleep member . is OLED in sleep mode

Returns
value of _sleep if true OLED is off and in sleep mode, 500uA.

◆ OLEDPowerDown()

void ERMCH1115::OLEDPowerDown ( void  )

Power down function.

Disables screen and sets all independent GPIO low. call when powering down before end of operations

◆ OLEDReset()

void ERMCH1115::OLEDReset ( void  )

Resets OLED in a four wire setup called at start.

< Reset Delay in mS

< Reset Delay 2 in mS

◆ OLEDscroll()

void ERMCH1115::OLEDscroll ( uint8_t  bits)

Turns on Horizontal scroll.

Parameters
bits1 Horizontal scroll on , 0 Horizontal scroll off
Note
OLEDscrollSetup must be called before it

◆ OLEDscrollSetup()

void ERMCH1115::OLEDscrollSetup ( uint8_t  Timeinterval = ERMCH1115_TIME_SET,
uint8_t  Direction = ERMCH1115_SCROLL_SETUP,
uint8_t  mode = ERMCH1115_SET_SCROLL_MODE 
)

Sets up Horizontal Scroll.

Parameters
Timeinterval0x00 -> 0x07 , 0x00 = 6 frames
Direction0x26 right 0x27 left (A2 – A0)
modeSet Scroll Mode: (28H – 2BH) 0x28 = continuous

◆ OLEDSetBufferPtr()

uint8_t ERMCH1115::OLEDSetBufferPtr ( uint8_t  width,
uint8_t  height,
uint8_t *  pBuffer,
uint16_t  sizeOfBuffer 
)

sets the buffer pointer to the users screen data buffer

Parameters
widthwidth of buffer in pixels
heightheight of buffer in pixels
pBufferthe buffer array which decays to pointer
sizeOfBuffersize of buffer
Returns
Will return:
  1. 0. Success
  2. 2. Buffer size calculations are incorrect BufferSize = w * (h/8),
  3. 3. Not a valid pointer object.

◆ OLEDSPISetup()

void ERMCH1115::OLEDSPISetup ( spi_inst_t *  spiType,
uint32_t  spiSpeedKhz,
int8_t  cd,
int8_t  rst,
int8_t  cs,
int8_t  sclk,
int8_t  din 
)

begin Method initialise OLED Sets pinmodes and SPI setup

Parameters
spiTypeSPI instance
spiSpeedKhzSPI bus speed in kiloHz
cdGPIO command or data pin
rstGPIO reset line
csGPIO chip select lin
sclkGPIO SPI clock line tied to SPI instance
dinGPIO SPI data line tied to SPI instance(MOSI)

Max SPI speed on the PICO is 62.5Mhz

◆ send_command()

void ERMCH1115::send_command ( uint8_t  command,
uint8_t  value 
)
private

Sends a command to the display.

Parameters
commandCommand to send
valuethe values to change
Note
command and value will be combined with OR

◆ send_data()

void ERMCH1115::send_data ( uint8_t  data)
private

Send data byte with SPI to ERMCH1115.

Parameters
datathe data byte to send

Member Data Documentation

◆ _display_CD

int8_t ERMCH1115::_display_CD
private

GPIO Data or command line

◆ _display_CS

int8_t ERMCH1115::_display_CS
private

GPIO Chip select line

◆ _display_DIN

int8_t ERMCH1115::_display_DIN
private

GPIO MOSI Line tied to chosen SPI interface

◆ _display_RST

int8_t ERMCH1115::_display_RST
private

GPIO Reset line

◆ _display_SCLK

int8_t ERMCH1115::_display_SCLK
private

GPIO Clock Line tied to chosen SPI interface

◆ _OLED_HEIGHT

int16_t ERMCH1115::_OLED_HEIGHT = 64
private

Height of OLED Screen in pixels

◆ _OLED_PAGE_NUM

int8_t ERMCH1115::_OLED_PAGE_NUM = (_OLED_HEIGHT / 8)
private

Number of byte size pages OLED screen is divided into

◆ _OLED_WIDTH

int16_t ERMCH1115::_OLED_WIDTH = 128
private

Width of OLED Screen in pixels

◆ _OLEDbuffer

uint8_t* ERMCH1115::_OLEDbuffer = nullptr
private

Pointer to screen buffer data

◆ _OLEDcontrast

uint8_t ERMCH1115::_OLEDcontrast
private

Contrast default 0x80 datasheet 00-FF

◆ _sleep

bool ERMCH1115::_sleep = true
private

False awake/ON , true sleep/OFF

◆ ERMCH1115_ACTIVATE_SCROLL

constexpr uint8_t ERMCH1115::ERMCH1115_ACTIVATE_SCROLL = 0x2F
staticconstexprprivate

active Scroll mode

◆ ERMCH1115_BREATHEFFECT_DATA

constexpr uint8_t ERMCH1115::ERMCH1115_BREATHEFFECT_DATA = 0x81
staticconstexprprivate

Display Effect ON/OFF and Time Interval:

◆ ERMCH1115_BREATHEFFECT_SET

constexpr uint8_t ERMCH1115::ERMCH1115_BREATHEFFECT_SET = 0x23
staticconstexprprivate

Set Breathing Display Effect:

◆ ERMCH1115_COM_LEVEL_DATA_SET

constexpr uint8_t ERMCH1115::ERMCH1115_COM_LEVEL_DATA_SET = 0x40
staticconstexprprivate

VCOM Deselect Level Data Set: (00H - FFH)

◆ ERMCH1115_COM_LEVEL_MODE_SET

constexpr uint8_t ERMCH1115::ERMCH1115_COM_LEVEL_MODE_SET = 0xDB
staticconstexprprivate

COM Deselect Level Mode Set: (DBH)

◆ ERMCH1115_COMMON_SCAN_DIR

constexpr uint8_t ERMCH1115::ERMCH1115_COMMON_SCAN_DIR = 0xC0
staticconstexprprivate

Set Common Op Scan Dir:C0H - C8H Flip vertical

◆ ERMCH1115_CONTRAST_CONTROL

constexpr uint8_t ERMCH1115::ERMCH1115_CONTRAST_CONTROL = 0x81
staticconstexprprivate

Contrast Control Mode Set

◆ ERMCH1115_CONTRAST_DATA_DEFAULT

constexpr uint8_t ERMCH1115::ERMCH1115_CONTRAST_DATA_DEFAULT = 0x80
staticconstexprprivate

Contrast Data Reg Set = 0x00 to = 0xFF

◆ ERMCH1115_DC_MODE_SET

constexpr uint8_t ERMCH1115::ERMCH1115_DC_MODE_SET = 0xAD
staticconstexprprivate

DC-DC Control Mode Set

◆ ERMCH1115_DC_ONOFF_SET

constexpr uint8_t ERMCH1115::ERMCH1115_DC_ONOFF_SET = 0x8B
staticconstexprprivate

DC-DC ON/OFF Mode Set (8AH - 8BH) (a=off; b=on)

◆ ERMCH1115_DEACTIVATE_SCROLL

constexpr uint8_t ERMCH1115::ERMCH1115_DEACTIVATE_SCROLL = 0x2E
staticconstexprprivate

De-active Scroll mode

◆ ERMCH1115_DISPLAY_INVERT

constexpr uint8_t ERMCH1115::ERMCH1115_DISPLAY_INVERT = 0xA7
staticconstexprprivate

Display Inversion on

◆ ERMCH1115_DISPLAY_NORMAL

constexpr uint8_t ERMCH1115::ERMCH1115_DISPLAY_NORMAL = 0xA6
staticconstexprprivate

Display Inversion off

◆ ERMCH1115_DISPLAY_OFF

constexpr uint8_t ERMCH1115::ERMCH1115_DISPLAY_OFF = 0xAE
staticconstexprprivate

Turns off Display

◆ ERMCH1115_DISPLAY_ON

constexpr uint8_t ERMCH1115::ERMCH1115_DISPLAY_ON = 0xAF
staticconstexprprivate

Turns on Display

◆ ERMCH1115_ENTIRE_DISPLAY_OFF

constexpr uint8_t ERMCH1115::ERMCH1115_ENTIRE_DISPLAY_OFF = 0xA5
staticconstexprprivate

Forcibly turns the entire display on regardless of the contents of the display data RAM

◆ ERMCH1115_ENTIRE_DISPLAY_ON

constexpr uint8_t ERMCH1115::ERMCH1115_ENTIRE_DISPLAY_ON = 0xA4
staticconstexprprivate

Forcibly turns the entire display on regardless of the contents of the display data RAM

◆ ERMCH1115_EPAGE_ADR_SET

constexpr uint8_t ERMCH1115::ERMCH1115_EPAGE_ADR_SET = 0x07
staticconstexprprivate

End Page Address Set: (C2 – C0)

◆ ERMCH1115_HORIZONTAL_A_SCROLL_SET_ECOL

constexpr uint8_t ERMCH1115::ERMCH1115_HORIZONTAL_A_SCROLL_SET_ECOL = 0x7F
staticconstexprprivate

End Column Position Set: (B7 – B0)

◆ ERMCH1115_HORIZONTAL_A_SCROLL_SET_SCOL

constexpr uint8_t ERMCH1115::ERMCH1115_HORIZONTAL_A_SCROLL_SET_SCOL = 0x00
staticconstexprprivate

Start Column Position Set: (A7 – A0)

◆ ERMCH1115_HORIZONTAL_A_SCROLL_SETUP

constexpr uint8_t ERMCH1115::ERMCH1115_HORIZONTAL_A_SCROLL_SETUP = 0x24
staticconstexprprivate

Additional Horizontal Scroll Setup Mode Set: (24H)

◆ ERMCH1115_IREF_REG

constexpr uint8_t ERMCH1115::ERMCH1115_IREF_REG = 0x82
staticconstexprprivate

I REF Resistor Set

◆ ERMCH1115_IREF_SET

constexpr uint8_t ERMCH1115::ERMCH1115_IREF_SET = 0x00
staticconstexprprivate

I REF Resistor adjust

◆ ERMCH1115_MULTIPLEX_DATA_SET

constexpr uint8_t ERMCH1115::ERMCH1115_MULTIPLEX_DATA_SET = 0x3F
staticconstexprprivate

Multiplex Ration Data Set: (00H - 3FH)

◆ ERMCH1115_MULTIPLEX_MODE_SET

constexpr uint8_t ERMCH1115::ERMCH1115_MULTIPLEX_MODE_SET = 0xA8
staticconstexprprivate

Multiplex Ration Mode Set

◆ ERMCH1115_OFFSET_DATA_SET

constexpr uint8_t ERMCH1115::ERMCH1115_OFFSET_DATA_SET = 0x00
staticconstexprprivate

Display Offset Data Set: (00H~3FH)

◆ ERMCH1115_OFFSET_MODE_SET

constexpr uint8_t ERMCH1115::ERMCH1115_OFFSET_MODE_SET = 0xD3
staticconstexprprivate

Display Offset Mode Set:

◆ ERMCH1115_OSC_FREQ_DATA_SET

constexpr uint8_t ERMCH1115::ERMCH1115_OSC_FREQ_DATA_SET = 0xA0
staticconstexprprivate

Divide Ratio/Oscillator Frequency Data Set:

◆ ERMCH1115_OSC_FREQ_MODE_SET

constexpr uint8_t ERMCH1115::ERMCH1115_OSC_FREQ_MODE_SET = 0xD5
staticconstexprprivate

Divide Ratio/Oscillator Frequency Mode Set: (D5H)

◆ ERMCH1115_PRECHARGE_DATA_SET

constexpr uint8_t ERMCH1115::ERMCH1115_PRECHARGE_DATA_SET = 0x22
staticconstexprprivate

Discharge/Pre-charge Period Data Set: (00H - FFH)

◆ ERMCH1115_PRECHARGE_MODE_SET

constexpr uint8_t ERMCH1115::ERMCH1115_PRECHARGE_MODE_SET = 0xD9
staticconstexprprivate

Pre-charge Period Mode Set:

◆ ERMCH1115_SCROLL_SETUP

constexpr uint8_t ERMCH1115::ERMCH1115_SCROLL_SETUP = 0x26
staticconstexprprivate

Horizontal Scroll Setup: 26 right 27 left (A2 – A0)

◆ ERMCH1115_SEG_SET_PADS

constexpr uint8_t ERMCH1115::ERMCH1115_SEG_SET_PADS = 0xA2
staticconstexprprivate

Set SEG pads hw config: (A2H – A3H)

◆ ERMCH1115_SEG_SET_REMAP

constexpr uint8_t ERMCH1115::ERMCH1115_SEG_SET_REMAP = 0xA0
staticconstexprprivate

Set Segment Re-map: (A0H - A1H)

◆ ERMCH1115_SET_COLADD_LSB

constexpr uint8_t ERMCH1115::ERMCH1115_SET_COLADD_LSB = 0x00
staticconstexprprivate

Set Lower Column Address: (00H - 0FH)

◆ ERMCH1115_SET_COLADD_MSB

constexpr uint8_t ERMCH1115::ERMCH1115_SET_COLADD_MSB = 0x10
staticconstexprprivate

Set Higher Column Address: (10H – 1FH)

◆ ERMCH1115_SET_DISPLAY_START_LINE

constexpr uint8_t ERMCH1115::ERMCH1115_SET_DISPLAY_START_LINE = 0x40
staticconstexprprivate

Determine the initial display line

◆ ERMCH1115_SET_PAGEADD

constexpr uint8_t ERMCH1115::ERMCH1115_SET_PAGEADD = 0xB0
staticconstexprprivate

Set Page Address: (B0H - B7H)

◆ ERMCH1115_SET_PUMP_REG

constexpr uint8_t ERMCH1115::ERMCH1115_SET_PUMP_REG = 0x30
staticconstexprprivate

Output voltage (V PP ) internal charger pump.

◆ ERMCH1115_SET_PUMP_SET

constexpr uint8_t ERMCH1115::ERMCH1115_SET_PUMP_SET = 0x01
staticconstexprprivate

A1:A0[] 01 = 7.4v

◆ ERMCH1115_SET_SCROLL_MODE

constexpr uint8_t ERMCH1115::ERMCH1115_SET_SCROLL_MODE = 0x28
staticconstexprprivate

Set Scroll Mode: (28H – 2BH) = 0x28 = continuous

◆ ERMCH1115_SPAGE_ADR_SET

constexpr uint8_t ERMCH1115::ERMCH1115_SPAGE_ADR_SET = 0x00
staticconstexprprivate

Start Page Address Set = 0x00 = page 0

◆ ERMCH1115_TIME_SET

constexpr uint8_t ERMCH1115::ERMCH1115_TIME_SET = 0x00
staticconstexprprivate

Time Interval Set: (B2 – B0) = 0x00 = 6 frames

◆ spiInterface

spi_inst_t* ERMCH1115::spiInterface
private

SPI interface instance


The documentation for this class was generated from the following files: