|
@@ -104,27 +104,98 @@ __flash const unsigned char FontLookup [][5] = {
|
|
|
{ 0xfe, 0xfb, 0xfb, 0xfb, 0xfe }, // 2/3 \x83
|
|
|
{ 0xfe, 0xe3, 0xe3, 0xe3, 0xfe }, // 1/3 \x84
|
|
|
{ 0xfe, 0x83, 0x83, 0x83, 0xfe }, // 0/3 \x85
|
|
|
+ { 0x10, 0x20, 0x7e, 0x20, 0x10 }, // ↓ \x86
|
|
|
+ { 0x08, 0x04, 0x7e, 0x04, 0x08 }, // ↑ \x87
|
|
|
};
|
|
|
-/*
|
|
|
-__flash const unsigned char custom_chars[] = {
|
|
|
- 0b00000, /* 0x01 down arrow *//*
|
|
|
- 0b00100,
|
|
|
- 0b00100,
|
|
|
- 0b00100,
|
|
|
- 0b10101,
|
|
|
- 0b01110,
|
|
|
- 0b00100,
|
|
|
- 0b00000,
|
|
|
-
|
|
|
- 0b00000, /* 0x02 up arrow *//*
|
|
|
- 0b00100,
|
|
|
- 0b01110,
|
|
|
- 0b10101,
|
|
|
- 0b00100,
|
|
|
- 0b00100,
|
|
|
- 0b00100,
|
|
|
- 0b00000,
|
|
|
-};*/
|
|
|
+
|
|
|
+static inline void uc1601s_set_column_address(unsigned char addr) {
|
|
|
+ uc1601s_write_command(UC1601S_CA30 | (addr&0x0f));
|
|
|
+ uc1601s_write_command(UC1601S_CA74 | (addr>>4));
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_temp_compensation(unsigned char tc) {
|
|
|
+ tc &= 0x3;
|
|
|
+ uc1601s_write_command(UC1601S_TC | tc);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_power_control(unsigned char pc) {
|
|
|
+ pc &= 0x7;
|
|
|
+ uc1601s_write_command(UC1601S_PC | pc);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_scroll_line(unsigned char sl) {
|
|
|
+ sl &= 0x3f;
|
|
|
+ uc1601s_write_command(UC1601S_SL | sl);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_page_address(unsigned char pa) {
|
|
|
+ pa &= 0x0f;
|
|
|
+ uc1601s_write_command(UC1601S_PA | pa);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_vbias(unsigned char pm) {
|
|
|
+ uc1601s_write_command(UC1601S_PM);
|
|
|
+ uc1601s_write_command(pm);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_partial_display(unsigned char lc) {
|
|
|
+ lc &= 0x1;
|
|
|
+ uc1601s_write_command(UC1601S_LC4 | lc);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_ram_address(unsigned char ac) {
|
|
|
+ ac &= 0x3;
|
|
|
+ uc1601s_write_command(UC1601S_AC | ac);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601_set_frame_rate(unsigned char lc) {
|
|
|
+ lc &= 0x1;
|
|
|
+ uc1601s_write_command(UC1601S_LC3 | lc);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_all_pixel_on(unsigned char dc) {
|
|
|
+ dc &= 0x1;
|
|
|
+ uc1601s_write_command(UC1601S_DC1 | dc);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_inverse_display(unsigned char dc) {
|
|
|
+ dc &= 0x1;
|
|
|
+ uc1601s_write_command(UC1601S_DC0 | dc);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_display_enable(unsigned char dc) {
|
|
|
+ dc &= 0x1;
|
|
|
+ uc1601s_write_command(UC1601S_DC2 | dc);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_lcd_mapping(unsigned char lc) {
|
|
|
+ lc &= 0x6;
|
|
|
+ uc1601s_write_command(UC1601S_LC21 | lc);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_system_reset(void) {
|
|
|
+ uc1601s_write_command(UC1601S_SYSTEMRESET);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_lcd_bias_ratio(unsigned char br) {
|
|
|
+ br &= 0x3;
|
|
|
+ uc1601s_write_command(UC1601S_BR | br);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_com_end(unsigned char cen) {
|
|
|
+ uc1601s_write_command(UC1601S_CEN);
|
|
|
+ uc1601s_write_command(cen);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_partial_display_start(unsigned char dst) {
|
|
|
+ uc1601s_write_command(UC1601S_DST);
|
|
|
+ uc1601s_write_command(dst);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void uc1601s_set_partial_display_end(unsigned char den) {
|
|
|
+ uc1601s_write_command(UC1601S_DEN);
|
|
|
+ uc1601s_write_command(den);
|
|
|
+}
|
|
|
|
|
|
void uc1601s_write_command(unsigned char cmd) {
|
|
|
expander_set_bit_no_send(UC1601S_CD_PORT, UC1601S_CD, 0);
|