Display_Lib_RPI 2.3.0
A C++ Library to connect electronic displays to Linux single board computers.
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ERM19264_UC1609 Class Reference

class to drive the ERM19264 UC1609 LCD More...

#include <ERM19264_UC1609_LCD_RDL.hpp>

Inheritance diagram for ERM19264_UC1609:
Inheritance graph
[legend]

Classes

struct  UC1609_Delays_t
 Struct to hold delay values used in driver. More...
 

Public Types

enum  LCD_rotate_command_e : uint8_t { UC1609_ROTATION_FLIP_TWO = 0x06 , UC1609_ROTATION_NORMAL = 0x04 , UC1609_ROTATION_FLIP_ONE = 0x02 , UC1609_ROTATION_FLIP_THREE = 0x00 }
 enum to hold LCD Rotate command constants More...
 
- Public Types inherited from bicolor_graphics
enum  displayBC_rotate_e : uint8_t { BC_Degrees_0 = 0 , BC_Degrees_90 = 1 , BC_Degrees_180 = 2 , BC_Degrees_270 = 3 }
 
enum  pixel_color_e : uint8_t { WHITE = 0 , BLACK = 1 , INVERSE = 2 }
 
- Public Types inherited from Print
enum  BaseNum : uint8_t { RDL_DEC = 10 , RDL_HEX = 16 , RDL_OCT = 8 , RDL_BIN = 2 }
 

Public Member Functions

 ERM19264_UC1609 (int16_t lcdwidth, int16_t lcdheight, int8_t rst, int8_t cd, int8_t cs, int8_t sclk, int8_t din)
 init the LCD class object
 
 ERM19264_UC1609 (int16_t lcdwidth, int16_t lcdheight, int8_t rst, int8_t cd)
 init the LCD class object
 
virtual void drawPixel (int16_t x, int16_t y, uint8_t colour) override
 Draws a Pixel to the screen , overrides the graphics library.
 
rdlib::Return_Codes_e LCDupdate (void)
 updates the buffer i.e. writes it to the screen
 
rdlib::Return_Codes_e LCDclearBuffer (void)
 clears the buffer memory i.e. does NOT write to the screen
 
void LCDBuffer (int16_t x, int16_t y, uint8_t w, uint8_t h, std::span< uint8_t > data)
 Draw a data array to the screen.
 
rdlib::Return_Codes_e LCDSetBufferPtr (uint8_t width, uint8_t height, std::span< uint8_t > data)
 sets the buffer pointer to the users screen data buffer
 
void LCDBitmap (int16_t x, int16_t y, uint8_t w, uint8_t h, const std::span< const uint8_t > data)
 Draw a bitmap into the screen.
 
rdlib::Return_Codes_e LCDbegin (uint8_t AddressSet, uint8_t VbiasPot, int device, int channel, int speed, int flags, int gpioDev)
 begin Method initialise LCD Sets pinmodes and SPI setup HW SPI
 
rdlib::Return_Codes_e LCDbegin (uint8_t AddressSet, uint8_t VbiasPot, int gpioDev)
 begin Method initialise LCD for software SPI
 
void LCDinit (void)
 Called from LCDbegin carries out Power on sequence and register init Can be used to reset LCD to default values.
 
void LCDEnable (uint8_t on)
 Turns On Display.
 
void LCDFillScreen (uint8_t pixel)
 Fill the screen NOT the buffer with a datapattern.
 
void LCDFillPage (uint8_t page_num, uint8_t pixels)
 Fill the chosen page at page_num with a datapattern.
 
rdlib::Return_Codes_e LCDrotate (LCD_rotate_command_e rotatevalue)
 Rotates the display by sending commands to display.
 
void LCDinvert (uint8_t on)
 invert the display
 
void LCDallpixelsOn (uint8_t bits)
 turns on all Pixels
 
void LCDscroll (uint8_t bits)
 Scroll the displayed image up by SL rows.
 
void LCDReset (void)
 Resets LCD in a four wire setup called at start and should also be called in a controlled power down setting.
 
void LCDPowerDown (void)
 Powerdown procedure for LCD see datasheet P40.
 
rdlib::Return_Codes_e LCDSPIoff (void)
 End SPI operations.
 
bool LCDIssleeping (void)
 LCD Is Sleeping?
 
uint16_t LCD_HighFreqDelayGet (void)
 Freq delay used in SW SPI getter, uS delay used in CustomshiftOut method.
 
void LCD_HighFreqDelaySet (uint16_t)
 Freq delay used in SW SPI setter, uS delay used in CustomshiftOut method.
 
- Public Member Functions inherited from bicolor_graphics
 bicolor_graphics (int16_t w, int16_t h)
 init the Display Graphics class object
 
rdlib::Return_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.
 
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).
 
rdlib::Return_Codes_e drawFastVLine (int16_t x, int16_t y, int16_t h, uint8_t color)
 Draws a vertical line starting at (x,y) with height h.
 
rdlib::Return_Codes_e 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 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 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 where (x0,y0) are center coordinates an r is circle 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 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.
 
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 of 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 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, bool useTriangleSplit=true)
 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.
 
rdlib::Return_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.
 
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.
 
void setCursor (int16_t x, int16_t y)
 set the cursor position
 
void setRotation (displayBC_rotate_e m)
 Sets the _rotation of the display.
 
displayBC_rotate_e getRotation ()
 Gets the _rotation of the display.
 
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)
 
virtual size_t write (uint8_t) override
 write method used in the print class when user calls print
 
rdlib::Return_Codes_e writeChar (int16_t x, int16_t y, char value)
 Write 1 character on display.
 
rdlib::Return_Codes_e writeCharString (int16_t x, int16_t y, char *text)
 Write Text character array on Display.
 
void setTextWrap (bool w)
 turn on or off screen wrap of the text
 
void setDrawBitmapAddr (bool mode)
 sets the data addressing mode in drawBitmap function.
 
rdlib::Return_Codes_e drawBitmap (int16_t x, int16_t y, const std::span< const uint8_t > bitmap, int16_t w, int16_t h, uint8_t color, uint8_t bg)
 Draw a 1-bit color bitmap.
 
- Public Member Functions inherited from display_Fonts
 display_Fonts ()
 init the OLED font class object constructor
 
rdlib::Return_Codes_e setFont (display_Font_name_e)
 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 error flag by setting it to zero
 
virtual size_t write (const uint8_t *buffer, size_t size)
 define in the sub class
 
size_t write (const char *str)
 Writes a string to the output.
 
size_t write (const char *buffer, size_t size)
 Writes a buffer of a specified size to the output.
 
virtual int availableForWrite ()
 define in the sub class
 
size_t print (const char[])
 print an array
 
size_t print (char)
 print an character
 
size_t print (int, int=RDL_DEC)
 print an integer of base number system
 
size_t print (unsigned int, int=RDL_DEC)
 print an unsigned integer of base number system
 
size_t print (long, int=RDL_DEC)
 print an long integer of base number system
 
size_t print (unsigned long, int=RDL_DEC)
 print an unsigned long integer of base number system
 
size_t print (double, int=2)
 print an double
 
size_t print (const std::string &)
 print an C++ string object
 
size_t println (const char[])
 Prints a character array followed by a newline.
 
size_t println (char)
 print an character followed by new line
 
size_t println (int, int=RDL_DEC)
 print an integer of base number system followed by new line
 
size_t println (unsigned int, int=RDL_DEC)
 print an unsigned integer of base number system followed by new line
 
size_t println (long, int=RDL_DEC)
 print an long integer of base number system followed by new line
 
size_t println (unsigned long, int=RDL_DEC)
 print an unsigned long integer of base number system followed by new line
 
size_t println (double, int=2)
 print an double
 
size_t println (void)
 Goto to new line.
 
size_t println (const std::string &s)
 print an C++ string object followed by new line
 
template<typename T >
size_t print (const std::vector< T > &v, int format=defaultFormat< T >())
 Print a vector of any type.
 
template<typename T >
size_t println (const std::vector< T > &vec, int format=defaultFormat< T >())
 Print a vector of elements followed by a newline.
 
template<typename T , size_t N>
size_t print (const std::array< T, N > &arr, int format=defaultFormat< T >())
 Print a std::array of any type.
 
template<typename T , size_t N>
size_t println (const std::array< T, N > &arr, int format=defaultFormat< T >())
 Print a std::array of elements followed by a newline.
 

Private Member Functions

void sendData (uint8_t data)
 Send data byte with SPI to UC1609.
 
void sendCommand (uint8_t command, uint8_t value)
 Sends a command to the display.
 
int8_t GetCommMode (void)
 Checks if software SPI is on.
 
void SoftwareSPIShiftOut (uint8_t val)
 used in software SPI mode to shift out data
 

Private Attributes

int8_t _Display_CS
 
int8_t _Display_DC
 
int8_t _Display_RST
 
int8_t _Display_SCLK
 
int8_t _Display_SDATA
 
int _DeviceNumGpioChip = 0
 
int _GpioHandle = 0
 
int16_t _LCD_WIDTH = 192
 
int16_t _LCD_HEIGHT = 64
 
int8_t _LCD_PAGE_NUM = (_LCD_HEIGHT/8)
 
std::span< uint8_t_LCDbufferScreen
 
bool _sleep = true
 
uint8_t _VbiasPOT = 0x49
 
uint8_t _AddressCtrl = 0x02
 
int _spiHandle = 0
 
int _spiDev = 0
 
int _spiChan = 0
 
int _spiBaud = 50000
 
int _spiFlags = 0
 
int8_t _LCD_mode = 2
 
uint16_t _LCD_HighFreqDelay = 0
 

Static Private Attributes

static constexpr uint8_t UC1609_SYSTEM_RESET = 0xE2
 
static constexpr uint8_t UC1609_POWER_CONTROL = 0x28
 
static constexpr uint8_t UC1609_PC_SET = 0x06
 
static constexpr uint8_t UC1609_ADDRESS_CONTROL = 0x88
 
static constexpr uint8_t UC1609_ADDRESS_SET = 0x02
 
static constexpr uint8_t UC1609_SET_PAGEADD = 0xB0
 
static constexpr uint8_t UC1609_SET_COLADD_LSB = 0x00
 
static constexpr uint8_t UC1609_SET_COLADD_MSB = 0x10
 
static constexpr uint8_t UC1609_TEMP_COMP_REG = 0x27
 
static constexpr uint8_t UC1609_TEMP_COMP_SET = 0x00
 
static constexpr uint8_t UC1609_FRAMERATE_REG = 0xA0
 
static constexpr uint8_t UC1609_FRAMERATE_SET = 0x01
 
static constexpr uint8_t UC1609_BIAS_RATIO = 0xE8
 
static constexpr uint8_t UC1609_BIAS_RATIO_SET = 0x03
 
static constexpr uint8_t UC1609_GN_PM = 0x81
 
static constexpr uint8_t UC1609_DEFAULT_GN_PM = 0x49
 
static constexpr uint8_t UC1609_LCD_CONTROL = 0xC0
 
static constexpr uint8_t UC1609_DISPLAY_ON = 0xAE
 
static constexpr uint8_t UC1609_ALL_PIXEL_ON = 0xA4
 
static constexpr uint8_t UC1609_INVERSE_DISPLAY = 0xA6
 
static constexpr uint8_t UC1609_SCROLL = 0x40
 

Additional Inherited Members

- Protected Member Functions inherited from Print
void setWriteError (int err=0)
 
- Protected Attributes inherited from bicolor_graphics
displayBC_rotate_e _display_rotate = BC_Degrees_0
 
const int16_t WIDTH
 
const int16_t HEIGHT
 
int16_t _width
 
int16_t _height
 
int16_t _cursor_x
 
int16_t _cursor_y
 
float _arcAngleMax = 360.0f
 
int _arcAngleOffset = 0
 
bool _textwrap = true
 
- Protected Attributes inherited from display_Fonts
std::span< const uint8_t > _FontSelect = pFontDefault
 
uint8_t _Font_X_Size = 0x08
 
uint8_t _Font_Y_Size = 0x08
 
uint8_t _FontOffset = 0x20
 
uint8_t _FontNumChars = 0x5F
 

Detailed Description

class to drive the ERM19264 UC1609 LCD

Member Enumeration Documentation

◆ LCD_rotate_command_e

enum to hold LCD Rotate command constants

Note
two methods to rotate screen , use rotate command or rotate buffer
Enumerator
UC1609_ROTATION_FLIP_TWO 

mirror image Rotation LCD command

UC1609_ROTATION_NORMAL 

Normal Rotation LCD command

UC1609_ROTATION_FLIP_ONE 

180 degree Rotation LCD command

UC1609_ROTATION_FLIP_THREE 

mirror image Rotation LCD command

Constructor & Destructor Documentation

◆ ERM19264_UC1609() [1/2]

ERM19264_UC1609::ERM19264_UC1609 ( int16_t  lcdwidth,
int16_t  lcdheight,
int8_t  rst,
int8_t  cd,
int8_t  cs,
int8_t  sclk,
int8_t  din 
)

init the LCD class object

Parameters
lcdwidthwidth of LCD in pixels
lcdheightheight of LCD in pixels
rstGPIO reset
cdGPIO data or command
csGPIO Chip select
sclkGPIO SPI Clock
dinGPIO MOSI
Note
Software SPI version (mode 3) , sub class of bicolor_graphics

◆ ERM19264_UC1609() [2/2]

ERM19264_UC1609::ERM19264_UC1609 ( int16_t  lcdwidth,
int16_t  lcdheight,
int8_t  rst,
int8_t  cd 
)

init the LCD class object

Parameters
lcdwidthwidth of LCD in pixels
lcdheightheight of LCD in pixels
rstGPIO reset
cdGPIO data or command
Note
Hardware SPI version (mode 2), sub class of bicolor_graphics

Member Function Documentation

◆ drawPixel()

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

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

Parameters
xx co-ord of pixel
yy co-ord of pixel
colourcolour of pixel

Implements bicolor_graphics.

◆ GetCommMode()

int8_t ERM19264_UC1609::GetCommMode ( void  )
private

Checks if software SPI is on.

Returns
2 if hardware SPi on , 3 for software spi

◆ LCD_HighFreqDelayGet()

uint16_t ERM19264_UC1609::LCD_HighFreqDelayGet ( void  )

Freq delay used in SW SPI getter, uS delay used in CustomshiftOut method.

Returns
_LCD_HighFreqDelay

◆ LCD_HighFreqDelaySet()

void ERM19264_UC1609::LCD_HighFreqDelaySet ( uint16_t  CommDelay)

Freq delay used in SW SPI setter, uS delay used in CustomshiftOut method.

Parameters
CommDelayuS GPIO delay used in software SPI

◆ LCDallpixelsOn()

void ERM19264_UC1609::LCDallpixelsOn ( uint8_t  bits)

turns on all Pixels

Parameters
bitsSet DC[1] to force all SEG drivers to output ON signals 1 all on , 0 all off

◆ LCDbegin() [1/2]

rdlib::Return_Codes_e ERM19264_UC1609::LCDbegin ( uint8_t  AddressSet,
uint8_t  VbiasPOT,
int  device,
int  channel,
int  speed,
int  flags,
int  gpioDev 
)

begin Method initialise LCD Sets pinmodes and SPI setup HW SPI

Parameters
AddressSetAC [2:0] registers for RAM addr ctrl. default=2 range 0-7
VbiasPOTcontrast default = 0x49 , range 0x00 to 0xFE
deviceA SPI device, >= 0.
channelA SPI channel, >= 0.
speedThe speed of serial communication in bits per second.
flagsThe flags may be used to modify the default behaviour. Set to 0(mode 0) for this device.
gpioDevThe device number of a gpiochip.
Returns
a rdlib::Return_Codes_e code
  1. rdlib::Success
  2. rdlib::WrongModeChosen
  3. rdlib::GpioChipDevice
  4. rdlib::GpioPinClaim
  5. rdlib::SPIOpenFailure

◆ LCDbegin() [2/2]

rdlib::Return_Codes_e ERM19264_UC1609::LCDbegin ( uint8_t  AddressSet,
uint8_t  VbiasPOT,
int  gpioDev 
)

begin Method initialise LCD for software SPI

Parameters
AddressSetAC [2:0] registers for RAM addr ctrl. default=2 range 0-7
VbiasPOTcontrast default = 0x49 , range 0x00 to 0xFE
gpioDevThe device number of a gpiochip.
Returns
a rdlib::Return_Codes_e code
  1. rdlib::Success
  2. rdlib::WrongModeChosen
  3. rdlib::GpioChipDevice
  4. rdlib::GpioPinClaim

◆ LCDBitmap()

void ERM19264_UC1609::LCDBitmap ( int16_t  x,
int16_t  y,
uint8_t  w,
uint8_t  h,
const std::span< const uint8_t data 
)

Draw a bitmap into the screen.

Parameters
xoffset 0-192
yoffset 0-64
wwidth 0-192
hheight 0-64
datapointer to the bitmap

◆ LCDBuffer()

void ERM19264_UC1609::LCDBuffer ( int16_t  x,
int16_t  y,
uint8_t  w,
uint8_t  h,
std::span< uint8_t data 
)

Draw a data array to the screen.

Parameters
xoffset 0-192
yoffset 0-64
wwidth 0-192
hheight 0-64
dataspan to the data array
Note
Called by LCDupdate internally to write buffer to screen , can be called standalone as well

◆ LCDclearBuffer()

rdlib::Return_Codes_e ERM19264_UC1609::LCDclearBuffer ( void  )

clears the buffer memory i.e. does NOT write to the screen

Returns
  1. Success
  2. BufferEmpty is buffer empty object

◆ LCDEnable()

void ERM19264_UC1609::LCDEnable ( uint8_t  bits)

Turns On Display.

Parameters
bits1 display on , 0 display off

◆ LCDFillPage()

void ERM19264_UC1609::LCDFillPage ( uint8_t  page_num,
uint8_t  dataPattern 
)

Fill the chosen page at page_num with a datapattern.

Parameters
page_numthe page number 0-7
dataPatterncan be set to 0 to FF

◆ LCDFillScreen()

void ERM19264_UC1609::LCDFillScreen ( uint8_t  dataPattern)

Fill the screen NOT the buffer with a datapattern.

Parameters
dataPatterncan be set to zero to clear screen (not buffer) range 0x00 to 0ff

◆ LCDinvert()

void ERM19264_UC1609::LCDinvert ( uint8_t  bits)

invert the display

Parameters
bits1 invert , 0 normal

◆ LCDIssleeping()

bool ERM19264_UC1609::LCDIssleeping ( void  )

LCD Is Sleeping?

Returns
bool value of _sleep if true LCD is off and in sleep mode

◆ LCDrotate()

rdlib::Return_Codes_e ERM19264_UC1609::LCDrotate ( LCD_rotate_command_e  rotatevalue)

Rotates the display by sending commands to display.

Parameters
rotatevalue4 possible values 000 010 100 110 (defined)

Set LC[2:1] for COM (row) mirror (MY), SEG (column) mirror (MX).

Note
If Mx is changed the buffer must BE updated see examples.
Returns
  1. Success
  2. GenericError if value not found in enum

◆ LCDscroll()

void ERM19264_UC1609::LCDscroll ( uint8_t  bits)

Scroll the displayed image up by SL rows.

The valid SL value is between 0 (for no scrolling) and (64). Setting SL outside of this range causes undefined effect on the displayed image.

Parameters
bits0-64 line number y-axis

◆ LCDSetBufferPtr()

rdlib::Return_Codes_e ERM19264_UC1609::LCDSetBufferPtr ( uint8_t  width,
uint8_t  height,
std::span< uint8_t buffer 
)

sets the buffer pointer to the users screen data buffer

Parameters
widthwidth of buffer in pixels
heightheight of buffer in pixels
bufferthe span to buffer data
Returns
Will return rdlib::Return_Codes_e enum
  1. Success rdlib::Success
  2. Error 1 rdlib::BufferSize
  3. Error 2 rdlib::BufferEmpty

◆ LCDSPIoff()

rdlib::Return_Codes_e ERM19264_UC1609::LCDSPIoff ( void  )

◆ LCDupdate()

rdlib::Return_Codes_e ERM19264_UC1609::LCDupdate ( void  )

updates the buffer i.e. writes it to the screen

Returns
  1. Success
  2. BufferEmpty if buffer is empty object

◆ sendCommand()

void ERM19264_UC1609::sendCommand ( 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

◆ sendData()

void ERM19264_UC1609::sendData ( uint8_t  dataByte)
private

Send data byte with SPI to UC1609.

Parameters
dataBytebyte the data byte to send

◆ SoftwareSPIShiftOut()

void ERM19264_UC1609::SoftwareSPIShiftOut ( uint8_t  value)
private

used in software SPI mode to shift out data

Parameters
valuethe byte to go out

if using high freq MCU the uS can be changed by LCDHighFreqDelaySet function, zero by default

Member Data Documentation

◆ _AddressCtrl

uint8_t ERM19264_UC1609::_AddressCtrl = 0x02
private

Set AC [2:0] Program registers for RAM address control. 0x00 to 0x07

◆ _DeviceNumGpioChip

int ERM19264_UC1609::_DeviceNumGpioChip = 0
private

The device number of a gpiochip ls /dev/gpio

◆ _Display_CS

int8_t ERM19264_UC1609::_Display_CS
private

GPIO Chip select line

◆ _Display_DC

int8_t ERM19264_UC1609::_Display_DC
private

GPIO Data or command line

◆ _Display_RST

int8_t ERM19264_UC1609::_Display_RST
private

GPIO Reset line

◆ _Display_SCLK

int8_t ERM19264_UC1609::_Display_SCLK
private

GPIO Clock Line Software SPI only

◆ _Display_SDATA

int8_t ERM19264_UC1609::_Display_SDATA
private

GPIO MOSI Line Software SPI only

◆ _GpioHandle

int ERM19264_UC1609::_GpioHandle = 0
private

This holds a handle to a gpiochip device opened by lgGpiochipOpen

◆ _LCD_HEIGHT

int16_t ERM19264_UC1609::_LCD_HEIGHT = 64
private

Height of screen in pixels

◆ _LCD_HighFreqDelay

uint16_t ERM19264_UC1609::_LCD_HighFreqDelay = 0
private

uS delay used in software SPI , option.

◆ _LCD_mode

int8_t ERM19264_UC1609::_LCD_mode = 2
private

2 = HW SPI 3 = SW SPI, other numbers reserved for future use

◆ _LCD_PAGE_NUM

int8_t ERM19264_UC1609::_LCD_PAGE_NUM = (_LCD_HEIGHT/8)
private

Number of 8 bit screen pages

◆ _LCD_WIDTH

int16_t ERM19264_UC1609::_LCD_WIDTH = 192
private

Width of screen in pixels

◆ _LCDbufferScreen

std::span<uint8_t> ERM19264_UC1609::_LCDbufferScreen
private

span to the screen buffer data

◆ _sleep

bool ERM19264_UC1609::_sleep = true
private

False = awake/ON , true = sleep/OFF

◆ _spiBaud

int ERM19264_UC1609::_spiBaud = 50000
private

The speed of serial communication in bits per second.

◆ _spiChan

int ERM19264_UC1609::_spiChan = 0
private

A SPI channel, >= 0.

◆ _spiDev

int ERM19264_UC1609::_spiDev = 0
private

A SPI device, >= 0.

◆ _spiFlags

int ERM19264_UC1609::_spiFlags = 0
private

The flags 2 LSB defines SPI mode

◆ _spiHandle

int ERM19264_UC1609::_spiHandle = 0
private

Hold a handle for the SPI device on the channel.

◆ _VbiasPOT

uint8_t ERM19264_UC1609::_VbiasPOT = 0x49
private

Contrast default 0x49 datasheet 00-FE

◆ UC1609_ADDRESS_CONTROL

constexpr uint8_t ERM19264_UC1609::UC1609_ADDRESS_CONTROL = 0x88
staticconstexprprivate

set RAM address control

◆ UC1609_ADDRESS_SET

constexpr uint8_t ERM19264_UC1609::UC1609_ADDRESS_SET = 0x02
staticconstexprprivate

Set AC [2:0] Program registers for RAM address control.

◆ UC1609_ALL_PIXEL_ON

constexpr uint8_t ERM19264_UC1609::UC1609_ALL_PIXEL_ON = 0xA4
staticconstexprprivate

sets on all Pixels on

◆ UC1609_BIAS_RATIO

constexpr uint8_t ERM19264_UC1609::UC1609_BIAS_RATIO = 0xE8
staticconstexprprivate

Bias Ratio. The ratio between V-LCD and V-D .

◆ UC1609_BIAS_RATIO_SET

constexpr uint8_t ERM19264_UC1609::UC1609_BIAS_RATIO_SET = 0x03
staticconstexprprivate

Set BR[1:0] = 11 (set to 9 default, 11b = 9)

◆ UC1609_DEFAULT_GN_PM

constexpr uint8_t ERM19264_UC1609::UC1609_DEFAULT_GN_PM = 0x49
staticconstexprprivate

default only used if user does not specify Vbias

◆ UC1609_DISPLAY_ON

constexpr uint8_t ERM19264_UC1609::UC1609_DISPLAY_ON = 0xAE
staticconstexprprivate

enables display

◆ UC1609_FRAMERATE_REG

constexpr uint8_t ERM19264_UC1609::UC1609_FRAMERATE_REG = 0xA0
staticconstexprprivate

Frame rate register

◆ UC1609_FRAMERATE_SET

constexpr uint8_t ERM19264_UC1609::UC1609_FRAMERATE_SET = 0x01
staticconstexprprivate

Set Frame Rate LC [4:3] 01b: 95 fps

◆ UC1609_GN_PM

constexpr uint8_t ERM19264_UC1609::UC1609_GN_PM = 0x81
staticconstexprprivate

Set V BIAS Potentiometer to fine tune V-D and V-LCD (double-byte command)

◆ UC1609_INVERSE_DISPLAY

constexpr uint8_t ERM19264_UC1609::UC1609_INVERSE_DISPLAY = 0xA6
staticconstexprprivate

inverts display

◆ UC1609_LCD_CONTROL

constexpr uint8_t ERM19264_UC1609::UC1609_LCD_CONTROL = 0xC0
staticconstexprprivate

Rotate map control

◆ UC1609_PC_SET

constexpr uint8_t ERM19264_UC1609::UC1609_PC_SET = 0x06
staticconstexprprivate

PC[2:0] 110, Internal V LCD (7x charge pump) + 10b: 1.4mA

◆ UC1609_POWER_CONTROL

constexpr uint8_t ERM19264_UC1609::UC1609_POWER_CONTROL = 0x28
staticconstexprprivate

Power control Address

◆ UC1609_SCROLL

constexpr uint8_t ERM19264_UC1609::UC1609_SCROLL = 0x40
staticconstexprprivate

scrolls , Set the scroll line number. 0-64

◆ UC1609_SET_COLADD_LSB

constexpr uint8_t ERM19264_UC1609::UC1609_SET_COLADD_LSB = 0x00
staticconstexprprivate

Column Address Set CA [3:0]

◆ UC1609_SET_COLADD_MSB

constexpr uint8_t ERM19264_UC1609::UC1609_SET_COLADD_MSB = 0x10
staticconstexprprivate

Column Address Set CA [7:4]

◆ UC1609_SET_PAGEADD

constexpr uint8_t ERM19264_UC1609::UC1609_SET_PAGEADD = 0xB0
staticconstexprprivate

Page address Set PA[3:0]

◆ UC1609_SYSTEM_RESET

constexpr uint8_t ERM19264_UC1609::UC1609_SYSTEM_RESET = 0xE2
staticconstexprprivate

System Reset

◆ UC1609_TEMP_COMP_REG

constexpr uint8_t ERM19264_UC1609::UC1609_TEMP_COMP_REG = 0x27
staticconstexprprivate

Temperature Compensation Register

◆ UC1609_TEMP_COMP_SET

constexpr uint8_t ERM19264_UC1609::UC1609_TEMP_COMP_SET = 0x00
staticconstexprprivate

TC[1:0] = 00b= -0.00%/ C


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