8 #ifndef NOKIA5110_TEXT_H
9 #define NOKIA5110_TEXT_H
26 #define SPI_FREQ 8000000
30 #define LCD_HIGH_FREQ_DELAY 1
36 #define LCD_COMMAND_MODE 0x21
37 #define LCD_CONTRAST 0xBF
38 #define LCD_TEMP_COEF 0x04
40 #define LCD_FUNCTIONSET 0x20
41 #define LCD_DISPLAYCONTROL 0x0C
42 #define LCD_DISPLAYCONTROL_INVERSE 0x0D
43 #define LCD_POWERDOWN 0x24
44 #define LCD_RESET_DELAY 50
55 #define _LCD_CLK_SetHigh digitalWrite(_LCD_CLK, true)
56 #define _LCD_CLK_SetLow digitalWrite(_LCD_CLK, false)
57 #define _LCD_DIN_SetHigh digitalWrite(_LCD_DIN, true)
58 #define _LCD_DIN_SetLow digitalWrite(_LCD_DIN, false)
59 #define _LCD_DC_SetHigh digitalWrite(_LCD_DC, true)
60 #define _LCD_DC_SetLow digitalWrite(_LCD_DC, false)
61 #define _LCD_CE_SetHigh digitalWrite(_LCD_CE, true)
62 #define _LCD_CE_SetLow digitalWrite(_LCD_CE, false)
63 #define _LCD_RST_SetHigh digitalWrite(_LCD_RST, true)
64 #define _LCD_RST_SetLow digitalWrite(_LCD_RST, false)
94 NOKIA5110_TEXT(uint8_t LCD_RST, uint8_t LCD_CE, uint8_t LCD_DC, int8_t LCD_DIN, int8_t LCD_CLK);
102 void LCDSPIWrite(
unsigned char DataOrCommand,
unsigned char data);
106 void LCDClear(uint8_t FillData = 0x00);
108 void LCDFillBlock(uint8_t FillData = 0xFF , uint8_t RowBlockNum = 0);
113 void LCDSetPixel(uint8_t col = 0, uint8_t row = 0);
117 virtual size_t write(uint8_t);
119 virtual void write(uint8_t);
#define LCD_BIAS
Definition: NOKIA5110_TEXT.h:39
#define LCD_CONTRAST
Definition: NOKIA5110_TEXT.h:37
LCDPaddingType_e
Definition: NOKIA5110_TEXT.h:83
@ LCDPadding_Both
Definition: NOKIA5110_TEXT.h:87
@ LCDPadding_RHS
Definition: NOKIA5110_TEXT.h:86
@ LCDPadding_LHS
Definition: NOKIA5110_TEXT.h:85
@ LCDPadding_None
Definition: NOKIA5110_TEXT.h:84
LCDFontType_e
Definition: NOKIA5110_TEXT.h:70
@ LCDFont_Thick
Definition: NOKIA5110_TEXT.h:72
@ LCDFont_Seven_Seg
Definition: NOKIA5110_TEXT.h:74
@ LCDFont_Wide
Definition: NOKIA5110_TEXT.h:75
@ LCDFont_Tiny
Definition: NOKIA5110_TEXT.h:76
@ LCDFont_Mega
Definition: NOKIA5110_TEXT.h:79
@ LCDFont_HomeSpun
Definition: NOKIA5110_TEXT.h:73
@ LCDFont_Default
Definition: NOKIA5110_TEXT.h:71
@ LCDFont_Huge
Definition: NOKIA5110_TEXT.h:78
@ LCDFont_Large
Definition: NOKIA5110_TEXT.h:77
Definition: NOKIA5110_TEXT.h:90
void LCDgotoXY(uint8_t x, uint8_t y)
LCDgotoXY gotoXY routine to position cursor (x,y)
Definition: NOKIA5110_TEXT.cpp:110
void LCDdraw_fonts_1TO6(char character)
Draw font 1-6: 8 bit high fonts.
Definition: NOKIA5110_TEXT.cpp:387
uint8_t _CurrentFontWidth
Definition: NOKIA5110_TEXT.h:143
uint8_t _Col
Definition: NOKIA5110_TEXT.h:140
void LCDClearBlock(uint8_t RowBlockNum=0)
LCDClearBlock Clears one of the 6 row blocks(one byte height) on LCD by writing zeros to the line....
Definition: NOKIA5110_TEXT.cpp:135
void LCDsetContrast(uint8_t contrast)
LCDSetContrast to set LCD contrast.
Definition: NOKIA5110_TEXT.cpp:294
void LCDClear(uint8_t FillData=0x00)
LCDClear Clears the LCD by writing zeros to the entire screen.
Definition: NOKIA5110_TEXT.cpp:122
uint8_t _LCD_CE
Definition: NOKIA5110_TEXT.h:130
uint8_t _LCD_RST
Definition: NOKIA5110_TEXT.h:129
uint8_t _contrast
Definition: NOKIA5110_TEXT.h:135
virtual void write(uint8_t)
write is used by print super class simply wraps LCDCharacter when called by print
Definition: NOKIA5110_TEXT.cpp:589
uint8_t _Block
Definition: NOKIA5110_TEXT.h:139
uint8_t _CurrentFontOffset
Definition: NOKIA5110_TEXT.h:144
bool _inverse
Definition: NOKIA5110_TEXT.h:137
void LCDenableSleep(void)
LCDenableSleep Put the LCD to Sleep function.
Definition: NOKIA5110_TEXT.cpp:305
void LCDSetPixel(uint8_t col=0, uint8_t row=0)
LCDSetPixel Method to set a individual pixel.
Definition: NOKIA5110_TEXT.cpp:283
void LCDdraw_fonts_7(char character)
used to draw fonts 7 large
Definition: NOKIA5110_TEXT.cpp:438
void LCDSPIWrite(unsigned char DataOrCommand, unsigned char data)
LCDSPIWrite write to display.
Definition: NOKIA5110_TEXT.cpp:217
bool LCDIsSleeping(void)
LCDisSleeping.
Definition: NOKIA5110_TEXT.cpp:569
int8_t _LCD_CLK
Definition: NOKIA5110_TEXT.h:133
bool isHardwareSPI(void)
isHardwareSPI
Definition: NOKIA5110_TEXT.cpp:576
NOKIA5110_TEXT(uint8_t LCD_RST, uint8_t LCD_CE, uint8_t LCD_DC, int8_t LCD_DIN, int8_t LCD_CLK)
Software SPI default.
Definition: NOKIA5110_TEXT.cpp:20
bool _sleep
Definition: NOKIA5110_TEXT.h:138
void LCDString(const char *characters)
LCDString given a string of characters, one by one is passed to the LCD.
Definition: NOKIA5110_TEXT.cpp:272
void LCDCustomChar(const unsigned char character[], uint16_t numChars, LCDPaddingType_e, bool ProgMemLocale)
LCDCustomChar Write a custom character or bitmap to screen X by Y.
Definition: NOKIA5110_TEXT.cpp:360
int8_t _LCD_DIN
Definition: NOKIA5110_TEXT.h:132
void LCDFont(LCDFontType_e FontNumber)
LCDFont.
Definition: NOKIA5110_TEXT.cpp:147
void LCDdisableSleep(void)
LCDdisableSleep Wake the LCD up from Sleep.
Definition: NOKIA5110_TEXT.cpp:319
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_TEXT.cpp:341
uint8_t _bias
Definition: NOKIA5110_TEXT.h:136
void LCDInit(bool Inverse=false, uint8_t Contrast=LCD_CONTRAST, uint8_t Bias=LCD_BIAS)
LCDinit This sends the commands to the PCD8544 to init LCD.
Definition: NOKIA5110_TEXT.cpp:53
void LCDCharacter(char character)
LCDCharacter print character Calls relevant method for the font set.
Definition: NOKIA5110_TEXT.cpp:249
uint8_t _CurrentFontNumber
Definition: NOKIA5110_TEXT.h:142
uint8_t _LCD_DC
Definition: NOKIA5110_TEXT.h:131
void LCDdraw_fonts_8TO9(char character)
used to draw fonts: huge and mega , 8 and 9
Definition: NOKIA5110_TEXT.cpp:479