#include "fw_hal.h"Go to the source code of this file.
Data Structures | |
| struct | FontDef_t |
Macros | |
| #define | ST7567_MODEL ST7567_MODEL_ST7567 |
| #define | ST7567_CS P35 |
| #define | ST7567_MOSI P34 |
| #define | ST7567_SCK P32 |
| #define | ST7567_RES P37 |
| #define | ST7567_DC P36 |
| #define | ST7567_BL P12 |
| #define | ST7567_WIDTH 128 |
| #define | ST7567_HEIGHT 64 |
| #define | ST7567_COLUMN_EXPAND 4 |
| #define | ST7567_PAGES 8 |
| #define | ST7567_X_ORIENT ST7567_SEG_DIRECTION_NORMAL |
| #define | ST7567_Y_ORIENT ST7567_COM_DIRECTION_NORMAL |
| #define | ST7567_MODEL_ST7565 0 |
| #define | ST7567_MODEL_ST7567 1 |
| #define | ST7567_DISPLAY_OFF 0xAE /* 0xae: Display OFF (sleep mode), default */ |
| #define | ST7567_DISPLAY_ON 0xAF /* 0xaf: Display ON in normal mode */ |
| #define | ST7567_SET_START_LINE 0x40 /* 0x40-7f: Set display start line */ |
| #define | ST7567_SET_START_LINE_MASK 0x3f |
| #define | ST7567_SET_PAGE_ADDRESS 0xB0 /* 0xb0-b7: Set page start address, 0 - 8 */ |
| #define | ST7567_SET_PAGE_ADDRESS_MASK 0x07 |
| #define | ST7567_SET_COLUMN_ADDRESS_MSB 0x10 /* 0x10-0x1f: Set 8bit column address - high 4 bits of 0 - 131 */ |
| #define | ST7567_SET_COLUMN_ADDRESS_MSB_MASK 0x0F |
| #define | ST7567_SET_COLUMN_ADDRESS_LSB 0x00 /* 0x00-0x0f: Set 8bit column address - low 4 bits of 0 - 131 */ |
| #define | ST7567_SET_COLUMN_ADDRESS_LSB_MASK 0x0F |
| #define | ST7567_SEG_DIRECTION_NORMAL 0xA0 /* 0xa0: Column address 0 is mapped to SEG0, default*/ |
| #define | ST7567_SEG_DIRECTION_REVERSE 0xA1 /* 0xa1: Column address 83H(131) is mapped to SEG0 */ |
| #define | ST7567_COM_DIRECTION_NORMAL 0xC0 /* 0xc0: Set COM output direction, normal mode */ |
| #define | ST7567_COM_DIRECTION_REVERSE 0xC8 /* 0xc8: Set COM output direction, reverse mode */ |
| #define | ST7567_INVERSE_DISPLAY_OFF 0xA6 /* 0xa6: Normal display */ |
| #define | ST7567_INVERSE_DISPLAY_ON 0xA7 /* 0xa7: Inverse display */ |
| #define | ST7567_ALL_PIXEL_ON 0xA5 /* 0xa5: Entire display ON */ |
| #define | ST7567_ALL_PIXEL_NORMAL 0xA4 /* 0xa4: Resume to RAM content display */ |
| #define | ST7567_BIAS_1_9 0xA2 /* 0xa2: Select BIAS setting 1/9 */ |
| #define | ST7567_BIAS_1_7 0xA3 /* 0xa3: Select BIAS setting 1/7 */ |
| #define | ST7567_READ_MODIFY_WRITE_START 0xE0 /* 0xe0: Enter the Read Modify Write mode */ |
| #define | ST7567_READ_MODIFY_WRITE_END 0xEE /* 0xee: Leave the Read Modify Write mode */ |
| #define | ST7567_RESET 0xE2 /* 0xe2: Software RESET */ |
| #define | ST7567_POWER_CONTROL 0x28 |
| #define | ST7567_POWER_CONTROL_VF 0x01 |
| #define | ST7567_POWER_CONTROL_VR 0x02 |
| #define | ST7567_POWER_CONTROL_VB 0x04 |
| #define | ST7567_REGULATION_RATIO 0x20 |
| #define | ST7567_REGULATION_RATIO_3_0 0x00 |
| #define | ST7567_REGULATION_RATIO_3_5 0x01 |
| #define | ST7567_REGULATION_RATIO_4_0 0x02 |
| #define | ST7567_REGULATION_RATIO_4_5 0x03 |
| #define | ST7567_REGULATION_RATIO_5_0 0x04 /* Default */ |
| #define | ST7567_REGULATION_RATIO_5_5 0x05 |
| #define | ST7567_REGULATION_RATIO_6_0 0x06 |
| #define | ST7567_REGULATION_RATIO_6_5 0x07 |
| #define | ST7567_SET_EV 0x81 |
| #define | ST7567_SET_EV_MASK 0x3F |
| #define | ST7567_SET_BOOSTER 0xF8 /* Set booster level */ |
| #define | ST7567_SET_BOOSTER_4X 0x00 |
| #define | ST7567_SET_BOOSTER_5X 0x01 |
| #define | ST7567_SET_BOOSTER_6X 0x11 |
| #define | ST7567_NOP 0xE3 |
| #define | ST7567_TEST 0xFE |
| #define | ST7567_TIMEOUT 20000 |
| #define | ST7567_COLOR_FRONT 1U |
| #define | ST7567_COLOR_BACK 0U |
Functions | |
| void | ST7567_WriteData (uint8_t dat) |
| Write a single byte data to ST7567. | |
| void | ST7567_WriteSameData (uint8_t dat, uint32_t size) |
| void | ST7567_WriteCommand (uint8_t command) |
| Write a single byte command to ST7567. | |
| void | ST7567_Reset (void) |
| Hardware reset ST7567 LCD. | |
| void | ST7567_Init (void) |
| Initializes ST7567 LCD. | |
| void | ST7567_SetPowerSaveMode (HAL_State_t state) |
| Powersave mode control. | |
| void | ST7567_SetBackLightState (HAL_State_t state) |
| Turn ST7567 LCD backlight on or off. | |
| void | ST7567_SetContrast (uint8_t val) |
| Turn ST7567 LCD backlight off. | |
| void | ST7567_UpdateScreen (void) |
| Update LCD display with buffer changes. | |
| void | ST7567_ToggleInvert (void) |
| Toggles pixels invertion inside internal RAM. | |
| void | ST7567_Fill (uint8_t Color) |
| Fills entire LCD with specified color. | |
| void | ST7567_DrawPixel (uint8_t x, uint8_t y, uint8_t color) |
| Draws pixel at desired location. | |
| void | ST7567_GotoXY (uint16_t x, uint16_t y) |
| Sets cursor pointer to desired location for strings. | |
| char | ST7567_Putc (char ch, FontDef_t *Font, uint8_t color) |
| Puts character to internal RAM. | |
| char | ST7567_Puts (char *str, FontDef_t *Font, uint8_t color) |
| Puts string to internal RAM. | |
| void | ST7567_DrawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t c) |
| Draws line on LCD. | |
Variables | |
| __CODE FontDef_t | Font_3x5 |
| __CODE FontDef_t | Font_5x7 |
| #define ST7567_ALL_PIXEL_NORMAL 0xA4 /* 0xa4: Resume to RAM content display */ |
| #define ST7567_ALL_PIXEL_ON 0xA5 /* 0xa5: Entire display ON */ |
| #define ST7567_BIAS_1_7 0xA3 /* 0xa3: Select BIAS setting 1/7 */ |
| #define ST7567_BIAS_1_9 0xA2 /* 0xa2: Select BIAS setting 1/9 */ |
| #define ST7567_COM_DIRECTION_NORMAL 0xC0 /* 0xc0: Set COM output direction, normal mode */ |
| #define ST7567_COM_DIRECTION_REVERSE 0xC8 /* 0xc8: Set COM output direction, reverse mode */ |
| #define ST7567_DISPLAY_OFF 0xAE /* 0xae: Display OFF (sleep mode), default */ |
| #define ST7567_DISPLAY_ON 0xAF /* 0xaf: Display ON in normal mode */ |
| #define ST7567_INVERSE_DISPLAY_OFF 0xA6 /* 0xa6: Normal display */ |
| #define ST7567_INVERSE_DISPLAY_ON 0xA7 /* 0xa7: Inverse display */ |
| #define ST7567_MODEL ST7567_MODEL_ST7567 |
| #define ST7567_POWER_CONTROL 0x28 |
| #define ST7567_READ_MODIFY_WRITE_END 0xEE /* 0xee: Leave the Read Modify Write mode */ |
| #define ST7567_READ_MODIFY_WRITE_START 0xE0 /* 0xe0: Enter the Read Modify Write mode */ |
| #define ST7567_REGULATION_RATIO 0x20 |
| #define ST7567_SEG_DIRECTION_NORMAL 0xA0 /* 0xa0: Column address 0 is mapped to SEG0, default*/ |
| #define ST7567_SEG_DIRECTION_REVERSE 0xA1 /* 0xa1: Column address 83H(131) is mapped to SEG0 */ |
| #define ST7567_SET_COLUMN_ADDRESS_LSB 0x00 /* 0x00-0x0f: Set 8bit column address - low 4 bits of 0 - 131 */ |
| #define ST7567_SET_COLUMN_ADDRESS_MSB 0x10 /* 0x10-0x1f: Set 8bit column address - high 4 bits of 0 - 131 */ |
| #define ST7567_SET_EV 0x81 |
This is double byte instruction. The first byte set ST7567 into EV adjust mode and the following instruction will change the EV setting. That means these 2 bytes must be used together. They control the electronic volume to adjust a suitable V0 voltage for the LCD.
| #define ST7567_SET_PAGE_ADDRESS 0xB0 /* 0xb0-b7: Set page start address, 0 - 8 */ |
| #define ST7567_SET_START_LINE 0x40 /* 0x40-7f: Set display start line */ |
| #define ST7567_X_ORIENT ST7567_SEG_DIRECTION_NORMAL |
| #define ST7567_Y_ORIENT ST7567_COM_DIRECTION_NORMAL |
Draws line on LCD.
| x0 | Line X start point. Valid input is 0 to ST7567_WIDTH - 1 |
| y0 | Line Y start point. Valid input is 0 to ST7567_HEIGHT - 1 |
| x1 | Line X end point. Valid input is 0 to ST7567_WIDTH - 1 |
| y1 | Line Y end point. Valid input is 0 to ST7567_HEIGHT - 1 |
| c | Color to be used. This parameter can be a value of ST7567_COLOR_t enumeration |
| None |
Definition at line 257 of file st7567.c.
Draws pixel at desired location.
| x | X location. This parameter can be a value between 0 and ST7567_WIDTH - 1 |
| y | Y location. This parameter can be a value between 0 and ST7567_HEIGHT - 1 |
| color | Color to be used for screen fill. This parameter can be a value of ST7567_COLOR_t enumeration |
| None |
Definition at line 164 of file st7567.c.
| void ST7567_Fill | ( | uint8_t | Color | ) |
Fills entire LCD with specified color.
| Color | Color to be used for screen fill, ST7567_COLOR_FRONT or ST7567_COLOR_BACK |
| None |
Definition at line 158 of file st7567.c.
Sets cursor pointer to desired location for strings.
| x | X location. This parameter can be a value between 0 and ST7567_WIDTH - 1 |
| y | Y location. This parameter can be a value between 0 and ST7567_HEIGHT - 1 |
| None |
Definition at line 183 of file st7567.c.
| void ST7567_Init | ( | void | ) |
Initializes ST7567 LCD.
| None |
| None |
Definition at line 68 of file st7567.c.
Puts character to internal RAM.
| ch | Character to be written |
| *Font | Pointer to FontDef_t structure with used font |
| color | Color used for drawing. This parameter can be a value of ST7567_COLOR_t enumeration |
| Character | written |
Definition at line 190 of file st7567.c.
Puts string to internal RAM.
| *str | String to be written |
| *Font | Pointer to FontDef_t structure with used font |
| color | Color used for drawing. This parameter can be a value of ST7567_COLOR_t enumeration |
| Zero | on success or character value when function failed |
Definition at line 237 of file st7567.c.
| void ST7567_Reset | ( | void | ) |
Hardware reset ST7567 LCD.
| None |
| None |
| void ST7567_SetBackLightState | ( | HAL_State_t | state | ) |
| void ST7567_SetContrast | ( | uint8_t | val | ) |
| void ST7567_SetPowerSaveMode | ( | HAL_State_t | state | ) |
Powersave mode control.
| state | HAL_State_ON:powersave mode, HAL_State_OFF:work mode |
| None |
Definition at line 100 of file st7567.c.
| void ST7567_ToggleInvert | ( | void | ) |
Toggles pixels invertion inside internal RAM.
| None |
| None |
Definition at line 144 of file st7567.c.
| void ST7567_UpdateScreen | ( | void | ) |
Update LCD display with buffer changes.
| None |
| None |
Definition at line 132 of file st7567.c.
| void ST7567_WriteCommand | ( | uint8_t | command | ) |
Write a single byte command to ST7567.
| command | command |
| None |
Definition at line 44 of file st7567.c.
| void ST7567_WriteData | ( | uint8_t | dat | ) |