13#include "hardware/spi.h"
14#include "pico/stdlib.h"
28 virtual void drawPixel(int16_t x, int16_t y, uint8_t color)
override;
31 void LCDInit(
bool Inverse, uint8_t Contrast,uint8_t Bias);
49 void LCDfillBlock(uint8_t FillData = 0xFF , uint8_t RowBlockNum = 0);
Class Controls SPI comms and LCD functionality.
Definition nokia5110.hpp:21
static constexpr uint8_t LCD_SETYADDR
Definition nokia5110.hpp:68
static constexpr uint8_t LCD_DISPLAYBLANK
Definition nokia5110.hpp:63
void LCDBuffer(std::span< uint8_t > data)
Draw an array to the screen.
Definition nokia5110.cpp:307
int8_t _display_DIN
Definition nokia5110.hpp:80
spi_inst_t * _spiInterface
Definition nokia5110.hpp:81
void LCDenableSleep(void)
Turn on sleep mode.
Definition nokia5110.cpp:234
DisplayRet::Ret_Codes_e LCDSetBufferPtr(uint8_t width, uint8_t height, std::span< uint8_t > buffer)
sets the buffer pointer to the users screen data buffer
Definition nokia5110.cpp:330
bool _inverse
Definition nokia5110.hpp:86
uint8_t _contrast
Definition nokia5110.hpp:84
DisplayRet::Ret_Codes_e LCDclearBuffer(void)
clears the buffer of the active screen pointed to by ActiveBuffer
Definition nokia5110.cpp:290
static constexpr uint8_t LCD_POWERDOWN
Definition nokia5110.hpp:58
static constexpr uint8_t LCD_DISPLAYALLON
Definition nokia5110.hpp:65
int16_t _LCD_Display_size
Definition nokia5110.hpp:93
void LCDgotoXY(uint8_t x, uint8_t y)
LCDgotoXY gotoXY routine to position cursor (x,y)
Definition nokia5110.cpp:353
DisplayRet::Ret_Codes_e LCDSPISetup(spi_inst_t *spi, uint32_t spiBaudRate, int8_t cd, int8_t rst, int8_t cs, int8_t sclk, int8_t din)
initialise LCD pinmodes and SPI setup
Definition nokia5110.cpp:32
virtual void drawPixel(int16_t x, int16_t y, uint8_t color) override
Set a single pixel in the buffer.
Definition nokia5110.cpp:162
static constexpr uint8_t LCD_SETTEMP
Definition nokia5110.hpp:71
int8_t _display_CD
Definition nokia5110.hpp:77
void LCDInit(bool Inverse, uint8_t Contrast, uint8_t Bias)
Init the LCD command sequence, called from begin This sends the commands to the PCD8544 to init LCD.
Definition nokia5110.cpp:79
void LCDSetContrast(uint8_t con)
Function to set contrast passed a byte.
Definition nokia5110.cpp:148
static constexpr uint8_t LCD_DISPLAYNORMAL
Definition nokia5110.hpp:64
bool LCDIsSleeping(void)
LCDisSleeping.
Definition nokia5110.cpp:263
void LCDinvertDisplay(bool inv)
inverts color on display
Definition nokia5110.cpp:219
bool _sleep
Definition nokia5110.hpp:87
int16_t _LCD_WIDTH
Definition nokia5110.hpp:90
int16_t _LCD_HEIGHT
Definition nokia5110.hpp:91
int8_t _display_RST
Definition nokia5110.hpp:78
static constexpr uint8_t LCD_ENTRYMODE
Definition nokia5110.hpp:59
void LCDWriteData(uint8_t data)
Writes a byte to the PCD8544.
Definition nokia5110.cpp:127
int8_t _display_SCLK
Definition nokia5110.hpp:79
uint8_t _bias
Definition nokia5110.hpp:85
void LCDfillScreen(uint8_t fill=0xFF)
Writes the buffer (with pattern) to the LCD.
Definition nokia5110.cpp:201
void LCDdisableSleep(void)
Turn off sleep mode.
Definition nokia5110.cpp:243
static constexpr uint8_t LCD_CONTRAST
Definition nokia5110.hpp:72
int8_t _display_CS
Definition nokia5110.hpp:76
int8_t _LCD_PAGE_NUM
Definition nokia5110.hpp:92
static constexpr uint8_t LCD_DISPLAYINVERTED
Definition nokia5110.hpp:66
void LCDSPIoff(void)
End SPI operations.
Definition nokia5110.cpp:105
std::span< uint8_t > _LCDbuffer
Definition nokia5110.hpp:94
static constexpr uint8_t LCD_SETXADDR
Definition nokia5110.hpp:69
static constexpr uint8_t LCD_DISPLAYCONTROL
Definition nokia5110.hpp:62
static constexpr uint8_t LCD_EXTENDEDINSTRUCTION
Definition nokia5110.hpp:60
static constexpr uint8_t LCD_FUNCTIONSET
Definition nokia5110.hpp:57
DisplayRet::Ret_Codes_e LCDupdate(void)
updates the LCD i.e. writes the shared buffer to the active screen pointed to by ActiveBuffer
Definition nokia5110.cpp:272
void LCDWriteCommand(uint8_t command)
Writes a command byte to the PCD8544.
Definition nokia5110.cpp:136
void LCDfillBlock(uint8_t FillData=0xFF, uint8_t RowBlockNum=0)
LCDFillBlock Clears one of the 6 row blocks(one byte height) on LCD.
Definition nokia5110.cpp:367
void LCDPowerDown(void)
Powerdown procedure for LCD see datasheet P40.
Definition nokia5110.cpp:113
static constexpr uint8_t LCD_BIAS
Definition nokia5110.hpp:73
Graphics class to hold graphic related functions.
Definition display_graphics.hpp:22
int16_t height(void) const
Gets the height of the display (per current _rotation)
Definition display_graphics.cpp:677
int16_t width(void) const
Gets the width of the display (per current _rotation)
Definition display_graphics.cpp:668
header file for the graphics based functions, 1-bit color displays.
Ret_Codes_e
Definition display_data.hpp:32