Rev 1017 | Rev 1031 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1017 | Rev 1019 | ||
|---|---|---|---|
| Line 9... | Line 9... | ||
| 9 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x83,0xfc,0xff,0xff,0xff,0xff,0x9f,0xe0,0xf8,0xf0,0xf0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf0,0xf0,0xf8,0xe0,0x1f,0xff,0xff,0xff,0xff,0xfc,0x83,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,//Line 5 |
9 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x83,0xfc,0xff,0xff,0xff,0xff,0x9f,0xe0,0xf8,0xf0,0xf0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf0,0xf0,0xf8,0xe0,0x1f,0xff,0xff,0xff,0xff,0xfc,0x83,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,//Line 5 |
| 10 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x1f,0xe1,0xfe,0xff,0xff,0x7f,0x1f,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0x1f,0x7f,0xff,0xff,0xfe,0xe1,0x1f,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0x3,0xb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xb,0x3,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfc,0xff,//Line 6 |
10 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x1f,0xe1,0xfe,0xff,0xff,0x7f,0x1f,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0x1f,0x7f,0xff,0xff,0xfe,0xe1,0x1f,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0x3,0xb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xb,0x3,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfc,0xff,//Line 6 |
| 11 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7,0xf8,0xff,0xff,0xf,0xf0,0xff,0xff,0xf,0x13,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x13,0xf,0xff,0xff,0xf0,0xf,0xff,0xff,0xf8,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//Line 7 |
11 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7,0xf8,0xff,0xff,0xf,0xf0,0xff,0xff,0xf,0x13,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x13,0xf,0xff,0xff,0xf0,0xf,0xff,0xff,0xf8,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//Line 7 |
| 12 | 0xff,0xbf,0x5f,0x5f,0x6f,0x77,0x79,0x7e,0x9f,0x7f,0x87,0xf8,0xff,0xff,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8,0xf8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0xff,0xff,0xff,0xf8,0x87,0x7f,0x9f,0x7e,0x79,0x77,0x6f,0x5f,0x5f,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x0,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff//Line 7 |
12 | 0xff,0xbf,0x5f,0x5f,0x6f,0x77,0x79,0x7e,0x9f,0x7f,0x87,0xf8,0xff,0xff,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8,0xf8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0xff,0xff,0xff,0xf8,0x87,0x7f,0x9f,0x7e,0x79,0x77,0x6f,0x5f,0x5f,0xbf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0x0,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff//Line 7 |
| 13 | }; |
13 | }; |
| - | 14 | #define SOLID 0 |
|
| - | 15 | #define TRANSPARENT 1 |
|
| - | 16 | uint8_t color=GLCD_COLOR_BLACK; |
|
| - | 17 | uint8_t Transparent=SOLID; |
|
| 14 | 18 | ||
| 15 | void numtoascii( int16_t num, char **str ); |
19 | void numtoascii( int16_t num, char **str ); |
| 16 | void signedtoascii(int16_t num, uint8_t decimalplace, char *string, uint8_t numberofdecimals); |
20 | void signedtoascii(int16_t num, uint8_t decimalplace, char *string, uint8_t numberofdecimals); |
| 17 | void unsignedtoascii(uint16_t num, uint8_t decimalplace, char *string, uint8_t numberofdecimals); |
21 | void unsignedtoascii(uint16_t num, uint8_t decimalplace, char *string, uint8_t numberofdecimals); |
| 18 | 22 | ||
| Line 67... | Line 71... | ||
| 67 | rxMsg->Header.ModuleId == act_ks0108_ID) |
71 | rxMsg->Header.ModuleId == act_ks0108_ID) |
| 68 | { |
72 | { |
| 69 | switch (rxMsg->Header.Command) |
73 | switch (rxMsg->Header.Command) |
| 70 | { |
74 | { |
| 71 | case CAN_MODULE_CMD_KS0108_LCD_CLEAR: |
75 | case CAN_MODULE_CMD_KS0108_LCD_CLEAR: |
| - | 76 | if (rxMsg->Length == 1) { |
|
| 72 | glcdSetColor((0x7f&rxMsg->Data[0])>>7); |
77 | glcdSetColor((0x7f&rxMsg->Data[0])>>7); |
| - | 78 | } |
|
| 73 | glcdClear(); |
79 | glcdClear(); |
| - | 80 | rxMsg->Data[0] = glcdGetColor()<<7; |
|
| - | 81 | StdCan_Set_direction(rxMsg->Header, DIRECTIONFLAG_FROM_OWNER); |
|
| - | 82 | rxMsg->Length = 1; |
|
| - | 83 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
|
| - | 84 | break; |
|
| - | 85 | case CAN_MODULE_CMD_KS0108_LCD_INVERT: |
|
| - | 86 | if (rxMsg->Length == 1) { |
|
| - | 87 | if ((0x7f&rxMsg->Data[0])>>7 != glcdGetColor()) |
|
| - | 88 | glcdInvert(); |
|
| - | 89 | } else |
|
| - | 90 | glcdInvert(); |
|
| - | 91 | rxMsg->Data[0] = glcdGetColor()<<7; |
|
| - | 92 | StdCan_Set_direction(rxMsg->Header, DIRECTIONFLAG_FROM_OWNER); |
|
| - | 93 | rxMsg->Length = 1; |
|
| - | 94 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
|
| 74 | break; |
95 | break; |
| 75 | - | ||
| 76 | case CAN_MODULE_CMD_KS0108_LCD_CURSOR: |
96 | case CAN_MODULE_CMD_KS0108_LCD_CURSOR: |
| - | 97 | if (rxMsg->Length == 2) { |
|
| 77 | glcdSetXY |
98 | glcdSetXY(rxMsg->Data[0]*6, rxMsg->Data[1]*8); |
| - | 99 | color = ((0x7f&rxMsg->Data[2])>>7); |
|
| - | 100 | Transparent = ((0xbf&rxMsg->Data[2])>>6); |
|
| - | 101 | } |
|
| - | 102 | rxMsg->Data[0] = glcdGetColor()<<7; |
|
| - | 103 | rxMsg->Data[0] = Transparent<<6; |
|
| - | 104 | rxMsg->Data[0] |= (0x3f & (glcdGetX()/6)); |
|
| - | 105 | rxMsg->Data[1] |= ((glcdGetY()/8)); |
|
| - | 106 | StdCan_Set_direction(rxMsg->Header, DIRECTIONFLAG_FROM_OWNER); |
|
| - | 107 | rxMsg->Length = 2; |
|
| - | 108 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
|
| - | 109 | ||
| 78 | break; |
110 | break; |
| 79 | 111 | ||
| 80 | case CAN_MODULE_CMD_KS0108_LCD_TEXTAT: |
112 | case CAN_MODULE_CMD_KS0108_LCD_TEXTAT: |
| 81 | glcdSetXY((0x3f&rxMsg->Data[0])*6, rxMsg->Data[1]*8); |
113 | glcdSetXY((0x3f&rxMsg->Data[0])*6, rxMsg->Data[1]*8); |
| 82 | for (n = 2; n < rxMsg->Length; n++) |
114 | for (n = 2; n < rxMsg->Length; n++) |
| 83 | { |
115 | { |
| - | 116 | if (((0xbf&rxMsg->Data[0])>>6)== TRANSPARENT) |
|
| - | 117 | glcdWriteCharTransparent((char)rxMsg->Data[n], (0x7f&rxMsg->Data[0])>>7); |
|
| - | 118 | else |
|
| 84 | glcdWriteChar((char)rxMsg->Data[n], (0x7f&rxMsg->Data[0])>>7); |
119 | glcdWriteChar((char)rxMsg->Data[n], (0x7f&rxMsg->Data[0])>>7); |
| 85 | } |
120 | } |
| 86 | break; |
121 | break; |
| 87 | 122 | ||
| 88 | case CAN_MODULE_CMD_KS0108_LCD_TEXT: |
123 | case CAN_MODULE_CMD_KS0108_LCD_TEXT: |
| 89 | for (n = 0; n < rxMsg->Length; n++) |
124 | for (n = 0; n < rxMsg->Length; n++) |
| 90 | { |
125 | { |
| - | 126 | if (Transparent == TRANSPARENT) |
|
| - | 127 | glcdWriteCharTransparent((char)rxMsg->Data[n], color); |
|
| - | 128 | else |
|
| 91 | glcdWriteChar((char)rxMsg->Data[n], |
129 | glcdWriteChar((char)rxMsg->Data[n], color); |
| 92 | } |
130 | } |
| 93 | break; |
131 | break; |
| 94 | 132 | ||
| 95 | case CAN_MODULE_CMD_KS0108_LCD_BACKLIGHT: |
133 | case CAN_MODULE_CMD_KS0108_LCD_BACKLIGHT: |
| 96 | if (rxMsg->Length > 0) { |
134 | if (rxMsg->Length > 0) { |