28#define ST7567_MODEL ST7567_MODEL_ST7567
31#define ST7567_MOSI P34
38#define ST7567_WIDTH 128
40#define ST7567_HEIGHT 64
42#define ST7567_COLUMN_EXPAND 4
46#define ST7567_X_ORIENT ST7567_SEG_DIRECTION_NORMAL
48#define ST7567_Y_ORIENT ST7567_COM_DIRECTION_NORMAL
50#define ST7567_MODEL_ST7565 0
51#define ST7567_MODEL_ST7567 1
54#define ST7567_DISPLAY_OFF 0xAE
55#define ST7567_DISPLAY_ON 0xAF
57#define ST7567_SET_START_LINE 0x40
58#define ST7567_SET_START_LINE_MASK 0x3f
60#define ST7567_SET_PAGE_ADDRESS 0xB0
61#define ST7567_SET_PAGE_ADDRESS_MASK 0x07
63#define ST7567_SET_COLUMN_ADDRESS_MSB 0x10
64#define ST7567_SET_COLUMN_ADDRESS_MSB_MASK 0x0F
66#define ST7567_SET_COLUMN_ADDRESS_LSB 0x00
67#define ST7567_SET_COLUMN_ADDRESS_LSB_MASK 0x0F
69#define ST7567_SEG_DIRECTION_NORMAL 0xA0
70#define ST7567_SEG_DIRECTION_REVERSE 0xA1
72#define ST7567_COM_DIRECTION_NORMAL 0xC0
73#define ST7567_COM_DIRECTION_REVERSE 0xC8
75#define ST7567_INVERSE_DISPLAY_OFF 0xA6
76#define ST7567_INVERSE_DISPLAY_ON 0xA7
78#define ST7567_ALL_PIXEL_ON 0xA5
79#define ST7567_ALL_PIXEL_NORMAL 0xA4
82#define ST7567_BIAS_1_9 0xA2
83#define ST7567_BIAS_1_7 0xA3
85#define ST7567_READ_MODIFY_WRITE_START 0xE0
86#define ST7567_READ_MODIFY_WRITE_END 0xEE
88#define ST7567_RESET 0xE2
94#define ST7567_POWER_CONTROL 0x28
95#define ST7567_POWER_CONTROL_VF 0x01
96#define ST7567_POWER_CONTROL_VR 0x02
97#define ST7567_POWER_CONTROL_VB 0x04
105#define ST7567_REGULATION_RATIO 0x20
106#define ST7567_REGULATION_RATIO_3_0 0x00
107#define ST7567_REGULATION_RATIO_3_5 0x01
108#define ST7567_REGULATION_RATIO_4_0 0x02
109#define ST7567_REGULATION_RATIO_4_5 0x03
110#define ST7567_REGULATION_RATIO_5_0 0x04
111#define ST7567_REGULATION_RATIO_5_5 0x05
112#define ST7567_REGULATION_RATIO_6_0 0x06
113#define ST7567_REGULATION_RATIO_6_5 0x07
121#define ST7567_SET_EV 0x81
122#define ST7567_SET_EV_MASK 0x3F
124#if (ST7567_MODEL == ST7567_MODEL_ST7565)
125 #define ST7567_MODE_SLEEP 0xAC
126 #define ST7567_MODE_NORMAL 0xAD
129#define ST7567_SET_BOOSTER 0xF8
130#define ST7567_SET_BOOSTER_4X 0x00
131#define ST7567_SET_BOOSTER_5X 0x01
132#define ST7567_SET_BOOSTER_6X 0x11
134#define ST7567_NOP 0xE3
135#define ST7567_TEST 0xFE
138#ifndef ST7567_TIMEOUT
139#define ST7567_TIMEOUT 20000
143#define ST7567_COLOR_FRONT 1U
145#define ST7567_COLOR_BACK 0U
uint8_t val[MAX7219_BLOCKS]
void ST7567_SetContrast(uint8_t val)
Turn ST7567 LCD backlight off.
void ST7567_WriteCommand(uint8_t command)
Write a single byte command to ST7567.
void ST7567_GotoXY(uint16_t x, uint16_t y)
Sets cursor pointer to desired location for strings.
void ST7567_WriteSameData(uint8_t dat, uint32_t size)
void ST7567_SetPowerSaveMode(HAL_State_t state)
Powersave mode control.
void ST7567_DrawPixel(uint8_t x, uint8_t y, uint8_t color)
Draws pixel at desired location.
void ST7567_Fill(uint8_t Color)
Fills entire LCD with specified color.
void ST7567_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t c)
Draws line on LCD.
void ST7567_ToggleInvert(void)
Toggles pixels invertion inside internal RAM.
char ST7567_Puts(char *str, FontDef_t *Font, uint8_t color)
Puts string to internal RAM.
void ST7567_Reset(void)
Hardware reset ST7567 LCD.
char ST7567_Putc(char ch, FontDef_t *Font, uint8_t color)
Puts character to internal RAM.
void ST7567_SetBackLightState(HAL_State_t state)
Turn ST7567 LCD backlight on or off.
void ST7567_Init(void)
Initializes ST7567 LCD.
void ST7567_WriteData(uint8_t dat)
Write a single byte data to ST7567.
__CODE FontDef_t Font_5x7
__CODE FontDef_t Font_3x5
void ST7567_UpdateScreen(void)
Update LCD display with buffer changes.