File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ void glcd_power_up(void)
58
58
59
59
void glcd_set_y_address (uint8_t y )
60
60
{
61
- glcd_command (ST7565R_PAGE_ADDRESS_SET | (0b00001111 & y ));
61
+ glcd_command (ST7565R_PAGE_ADDRESS_SET | (0x0F & y )); /* 0x0F = 0b00001111 */
62
62
}
63
63
64
64
void glcd_set_x_address (uint8_t x )
@@ -89,7 +89,7 @@ void glcd_set_column_lower(uint8_t addr)
89
89
90
90
void glcd_set_start_line (uint8_t addr )
91
91
{
92
- glcd_command ( ST7565R_SET_START_LINE | (0b00111111 & addr ));
92
+ glcd_command ( ST7565R_SET_START_LINE | (0x3F & addr )); /* 0x3F == 0b00111111 */
93
93
}
94
94
95
95
/** Clear the display immediately, does not buffer */
Original file line number Diff line number Diff line change 42
42
#define ST7565R_H_
43
43
44
44
/* Commands */
45
- #define ST7565R_DISPLAY_ON 0b10101111
46
- #define ST7565R_DISPLAY_OFF 0b10101110
47
- #define ST7565R_PAGE_ADDRESS_SET 0b10110000
45
+ #define ST7565R_DISPLAY_ON 0xAF /* 0b10101111 */
46
+ #define ST7565R_DISPLAY_OFF 0xAE /* 0b10101110 */
47
+ #define ST7565R_PAGE_ADDRESS_SET 0xB0 /* 0b10110000 */
48
48
#define ST7565R_COLUMN_ADDRESS_SET_LOWER 0x00
49
49
#define ST7565R_COLUMN_ADDRESS_SET_UPPER 0x10
50
- #define ST7565R_DISPLAY_NORMAL 0b10100100
51
- #define ST7565R_DISPLAY_ALL_ON 0b10100101
52
- #define ST7565R_NORMAL 0b10100000
53
- #define ST7565R_REVERSE 0b10100001
54
- #define ST7565R_RESET 0b11100010
55
- #define ST7565R_SET_START_LINE (1<<6)
50
+ #define ST7565R_DISPLAY_NORMAL 0xA4 /* 0b10100100 */
51
+ #define ST7565R_DISPLAY_ALL_ON 0xA5 /* 0b10100101 */
52
+ #define ST7565R_NORMAL 0xA0 /* 0b10100000 */
53
+ #define ST7565R_REVERSE 0xA1 /* 0b10100001 */
54
+ #define ST7565R_RESET 0xE2 /* 0b11100010 */
55
+ #define ST7565R_SET_START_LINE (1<<6)
56
56
57
57
/* These functions only available on ST7565 implementation (for now) */
58
58
You can’t perform that action at this time.
0 commit comments