ATY_LIB V2_102_230218
ATY_LIB for general devices or ALGO
 
Loading...
Searching...
No Matches
pcd8544.h
Go to the documentation of this file.
1// Copyright 2021 IOsetting <iosetting(at)outlook.com>
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef __FW_PCD8544__
16#define __FW_PCD8544__
17
18#include "fw_hal.h"
19
30#define PCD8544_CS P35
31#define PCD8544_MOSI P34
32#define PCD8544_SCK P32
33#define PCD8544_RES P37
34#define PCD8544_DC P36
35#define PCD8544_BL P12
36
37// X width
38#define PCD8544_WIDTH 84
39// Y height
40#define PCD8544_HEIGHT 48
41// Display RAM Pages
42#define PCD8544_PAGES 6
43
44#define PCD8544_FUNCTIONSET 0x20 // Function set
45#define PCD8544_POWERDOWN 0x04 // Function set, power down mode
46#define PCD8544_ENTRYMODE 0x02 // Function set, entry mode (vertical addressing)
47#define PCD8544_EXT_INSTRUCTION 0x01 // Function set, extended instruction set control
48
49#define PCD8544_DISPLAY_CONTROL 0x08 // Basic instruction set - Set display configuration
50#define PCD8544_DISPLAY_BLANK 0x00 // Display control, blank
51#define PCD8544_DISPLAY_NORMAL 0x04 // Display control, normal mode
52#define PCD8544_DISPLAY_ALLON 0x01 // Display control, all segments on
53#define PCD8544_DISPLAY_INVERTED 0x05 // Display control, inverse mode
54
55#define PCD8544_SET_YADDR 0x40 // Basic instruction set - Set Y address of RAM, 0 <= Y <= 5
56#define PCD8544_SET_XADDR 0x80 // Basic instruction set - Set X address of RAM, 0 <= X <= 83
57
58#define PCD8544_SET_TEMP 0x04 // Extended instruction set - Set temperature coefficient
59#define PCD8544_SET_BIAS 0x10 // Extended instruction set - Set bias system
60#define PCD8544_SET_VOP 0x80 // Extended instruction set - Write Vop to register
61
62typedef struct {
67 const uint8_t *dat;
68} FontDef_t;
69
70extern __CODE FontDef_t Font_3x5;
71extern __CODE FontDef_t Font_5x7;
72
79
87
93void PCD8544_WriteCommand(uint8_t command);
94
100void PCD8544_Reset(void);
101
108
115
122
130
136void PCD8544_SetDisplayAllOn(void);
137
144
150void PCD8544_SetDisplayBlank(void);
151
157void PCD8544_SetDisplayNormal(void);
158
164void PCD8544_Init(void);
165
172void PCD8544_Fill(uint8_t color);
173
180void PCD8544_UpdateScreen(void);
181
191
202void PCD8544_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t color);
203
211
220char PCD8544_Putc(char ch, FontDef_t* font, uint8_t color);
221
230char PCD8544_Puts(char* str, FontDef_t* Font, uint8_t color);
231
232#endif // __PCD8544_H_
return ch
__CODE int8_t dat[20]
unsigned long uint32_t
Definition: fw_types.h:20
unsigned short uint16_t
Definition: fw_types.h:19
HAL_State_t
Definition: fw_types.h:69
unsigned char uint8_t
Definition: fw_types.h:18
uint8_t val[MAX7219_BLOCKS]
char PCD8544_Putc(char ch, FontDef_t *font, uint8_t color)
Put one character to internal RAM.
Definition: pcd8544.c:281
void PCD8544_DrawPixel(uint8_t x, uint8_t y, uint8_t color)
Draws pixel at desired location.
Definition: pcd8544.c:159
void PCD8544_GotoXY(uint8_t x, uint8_t y)
Sets cursor pointer to desired location for strings.
Definition: pcd8544.c:274
void PCD8544_UpdateScreen(void)
Update LCD display with changes.
Definition: pcd8544.c:147
void PCD8544_SetTemperatureCoef(uint8_t val)
Set TCx (temperature coefficient)
Definition: pcd8544.c:101
void PCD8544_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t color)
Draws line on LCD.
Definition: pcd8544.c:177
char PCD8544_Puts(char *str, FontDef_t *Font, uint8_t color)
Puts string to internal RAM.
Definition: pcd8544.c:328
void PCD8544_Reset(void)
Hardware reset PCD8544 LCD.
Definition: pcd8544.c:57
void PCD8544_Init(void)
Initializes PCD8544 Display.
Definition: pcd8544.c:129
void PCD8544_SetDisplayAllOn(void)
Set PCD8544 To Turn On All Segments.
Definition: pcd8544.c:109
void PCD8544_SetDisplayInverted(void)
Set PCD8544 Display Mode to Inverted.
Definition: pcd8544.c:114
void PCD8544_SetBackLightState(HAL_State_t state)
Turn PCD8544 LCD backlight on or off.
Definition: pcd8544.c:136
void PCD8544_Fill(uint8_t color)
Fills entire LCD with specified color.
Definition: pcd8544.c:141
void PCD8544_SetContrast(uint8_t bias, uint8_t val)
Set the contrast level by adjusting Vlcd.
Definition: pcd8544.c:87
void PCD8544_WriteCommand(uint8_t command)
Write a single byte command to PCD8544.
Definition: pcd8544.c:40
void PCD8544_SetPowerDownMode(HAL_State_t state)
Powerdown mode control.
Definition: pcd8544.c:64
void PCD8544_SetBias(uint8_t val)
Set bias system level.
Definition: pcd8544.c:79
__CODE FontDef_t Font_5x7
Definition: pcd8544.c:548
void PCD8544_SetDisplayBlank(void)
Set PCD8544 Display Mode to Blank.
Definition: pcd8544.c:119
void PCD8544_WriteSameData(uint8_t dat, uint32_t size)
Definition: pcd8544.c:30
void PCD8544_SetDisplayNormal(void)
Set PCD8544 Display Mode to Normal.
Definition: pcd8544.c:124
void PCD8544_WriteData(uint8_t dat)
Writes single byte data to PCD8544.
Definition: pcd8544.c:23
__CODE FontDef_t Font_3x5
Definition: pcd8544.c:547
volatile int16_t y
Definition: main.c:34
volatile int16_t x
Definition: main.c:34
uint8_t height
Definition: pcd8544.h:64
const uint8_t * dat
Definition: pcd8544.h:67
uint8_t order
Definition: pcd8544.h:65
uint8_t bytes
Definition: pcd8544.h:66
uint8_t width
Definition: pcd8544.h:63