Rev 2044 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2044 | Rev 2222 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | #include "act_ks0108.h" |
2 | #include "act_ks0108.h" |
| 3 | 3 | ||
| - | 4 | #if GRAPHICS_DRIVER!=DOTMATRIX |
|
| 4 | static unsigned char Splash_left[] PROGMEM = { |
5 | static unsigned char Splash_left[] PROGMEM = { |
| 5 | 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,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,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,//Line 1 |
6 | 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,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,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,//Line 1 |
| 6 | 0xff,0xff,0xff,0x3,0x7f,0x7f,0xbf,0xbf,0xdf,0x7,0xff,0xff,0xff,0x3f,0xbf,0xdf,0xdf,0xdf,0x3f,0xff,0xff,0xff,0x3f,0x3f,0xdf,0x9f,0x7f,0x7f,0xbf,0x9f,0x3f,0xff,0xff,0x7f,0xbf,0xdf,0xdf,0x9f,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xc7,0xf3,0xf,0xff,0xff,0xff,0x1f,0xff,0xff,0xff,0xff,0x3f,0xdf,0xff,0xef,0xef,0xef,0x40,0x5,0xf7,0xff,0xff,0x3f,0xbf,0xdf,0xdf,0xdf,0x3f,0xff,0xff,0xff,0x1f,0x7f,0xdf,0x9f,0x7f,0x7f,0x9f,0xdf,0x3f,0xff,0xff,0xbf,0xbf,0xdf,0xdf,0xdf,0x3f,0xff,0xff,0xef,0xef,0xef,0x40,0x5,0xf7,0xff,0x1d,0xff,0xff,0xff,0xff,0x3f,0xbf,0xdf,0xdf,0xdf,0x3f,0xff,0xff,0xff,0x1f,0xff,0x7f,0x9f,0xdf,0x3f,0xff,0xff,0xff,0xff,0xff,//Line 2 |
7 | 0xff,0xff,0xff,0x3,0x7f,0x7f,0xbf,0xbf,0xdf,0x7,0xff,0xff,0xff,0x3f,0xbf,0xdf,0xdf,0xdf,0x3f,0xff,0xff,0xff,0x3f,0x3f,0xdf,0x9f,0x7f,0x7f,0xbf,0x9f,0x3f,0xff,0xff,0x7f,0xbf,0xdf,0xdf,0x9f,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xc7,0xf3,0xf,0xff,0xff,0xff,0x1f,0xff,0xff,0xff,0xff,0x3f,0xdf,0xff,0xef,0xef,0xef,0x40,0x5,0xf7,0xff,0xff,0x3f,0xbf,0xdf,0xdf,0xdf,0x3f,0xff,0xff,0xff,0x1f,0x7f,0xdf,0x9f,0x7f,0x7f,0x9f,0xdf,0x3f,0xff,0xff,0xbf,0xbf,0xdf,0xdf,0xdf,0x3f,0xff,0xff,0xef,0xef,0xef,0x40,0x5,0xf7,0xff,0x1d,0xff,0xff,0xff,0xff,0x3f,0xbf,0xdf,0xdf,0xdf,0x3f,0xff,0xff,0xff,0x1f,0xff,0x7f,0x9f,0xdf,0x3f,0xff,0xff,0xff,0xff,0xff,//Line 2 |
| 7 | 0xff,0xff,0xff,0xd0,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xe0,0xef,0xdf,0xdf,0xcf,0xe3,0xf8,0xff,0xff,0xff,0xc0,0xfe,0xff,0xff,0xe0,0xfa,0xff,0xff,0xe0,0xff,0xff,0xf8,0xe6,0xee,0xee,0xf6,0xf7,0xfb,0xff,0xff,0xef,0xf3,0xfc,0xfe,0xfe,0xfe,0xff,0xf0,0xff,0xff,0xf4,0xcf,0xdf,0xe7,0xfb,0xf0,0xe7,0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xff,0xe0,0xef,0xdf,0xdf,0xcf,0xe3,0xf8,0xff,0xff,0xff,0xc0,0xfe,0xff,0xff,0xe0,0xfa,0xff,0xff,0xe0,0xff,0xff,0xf3,0xeb,0xed,0xed,0xf5,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xff,0xe0,0xff,0xff,0xff,0xf0,0xcf,0xdf,0xdf,0xcf,0xe3,0xf8,0xff,0xff,0xff,0xf4,0xf9,0xfe,0xff,0xff,0xe0,0xff,0xff,0xff,0xff,0xff,//Line 3 |
8 | 0xff,0xff,0xff,0xd0,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xe0,0xef,0xdf,0xdf,0xcf,0xe3,0xf8,0xff,0xff,0xff,0xc0,0xfe,0xff,0xff,0xe0,0xfa,0xff,0xff,0xe0,0xff,0xff,0xf8,0xe6,0xee,0xee,0xf6,0xf7,0xfb,0xff,0xff,0xef,0xf3,0xfc,0xfe,0xfe,0xfe,0xff,0xf0,0xff,0xff,0xf4,0xcf,0xdf,0xe7,0xfb,0xf0,0xe7,0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xff,0xe0,0xef,0xdf,0xdf,0xcf,0xe3,0xf8,0xff,0xff,0xff,0xc0,0xfe,0xff,0xff,0xe0,0xfa,0xff,0xff,0xe0,0xff,0xff,0xf3,0xeb,0xed,0xed,0xf5,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xff,0xe0,0xff,0xff,0xff,0xf0,0xcf,0xdf,0xdf,0xcf,0xe3,0xf8,0xff,0xff,0xff,0xf4,0xf9,0xfe,0xff,0xff,0xe0,0xff,0xff,0xff,0xff,0xff,//Line 3 |
| 8 | 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,0x3f,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,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,0x7f,0xff,0xff,0xff,0xff,0xff,//Line 4 |
9 | 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,0x3f,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,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,0x7f,0xff,0xff,0xff,0xff,0xff,//Line 4 |
| 9 | 0xff,0xff,0xff,0xff,0xff,0xdf,0xef,0xef,0xef,0x1f,0xff,0xff,0xf,0xff,0xff,0xff,0xff,0x3f,0xcf,0xff,0xff,0x1f,0x9f,0xef,0xcf,0x3f,0x3f,0xdf,0xcf,0x1f,0xff,0xff,0x40,0x2f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x5f,0xef,0xef,0xef,0xff,0xff,0x3f,0x1f,0x6f,0x6f,0xcf,0x9f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xcf,0xf3,0xfc,0xff,0xff,0xff,0x47,0xb7,0xf7,0xf7,0xf7,0x77,0x8f,0xff,0xff,0xf,0x7f,0x3f,0xdf,0xdf,0xff,0xff,0x7f,0x9f,0xdf,0xef,0xef,0xef,0x1f,0xff,0xff,0xff,0xff,0xdd,0x3f,0xff,0xff,0xff,0x3f,0x1f,0x6f,0x6f,0xcf,0x9f,0xff,0xff,0xfd,0x3,0x7f,0xbf,0xdf,0xef,0xff,0xff,0xf7,0xf7,0xf7,0xa0,0x2,0xfb,0xff,0xff,0xff,//Line 5 |
10 | 0xff,0xff,0xff,0xff,0xff,0xdf,0xef,0xef,0xef,0x1f,0xff,0xff,0xf,0xff,0xff,0xff,0xff,0x3f,0xcf,0xff,0xff,0x1f,0x9f,0xef,0xcf,0x3f,0x3f,0xdf,0xcf,0x1f,0xff,0xff,0x40,0x2f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x5f,0xef,0xef,0xef,0xff,0xff,0x3f,0x1f,0x6f,0x6f,0xcf,0x9f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0xcf,0xf3,0xfc,0xff,0xff,0xff,0x47,0xb7,0xf7,0xf7,0xf7,0x77,0x8f,0xff,0xff,0xf,0x7f,0x3f,0xdf,0xdf,0xff,0xff,0x7f,0x9f,0xdf,0xef,0xef,0xef,0x1f,0xff,0xff,0xff,0xff,0xdd,0x3f,0xff,0xff,0xff,0x3f,0x1f,0x6f,0x6f,0xcf,0x9f,0xff,0xff,0xfd,0x3,0x7f,0xbf,0xdf,0xef,0xff,0xff,0xf7,0xf7,0xf7,0xa0,0x2,0xfb,0xff,0xff,0xff,//Line 5 |
| 10 | 0xff,0xff,0xff,0xff,0xf9,0xf6,0xf6,0xfa,0xfa,0xf8,0xff,0xff,0xf8,0xe7,0xef,0xf3,0xfd,0xfc,0xf1,0xff,0xff,0xe0,0xff,0xff,0xff,0xf0,0xfd,0xff,0xff,0xf0,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xcf,0xc3,0xd3,0xe3,0xff,0xff,0xff,0xf7,0xe7,0xee,0xf6,0xf1,0xff,0xff,0xfc,0xf3,0xf7,0xf7,0xfb,0xfb,0xfd,0xff,0xff,0xff,0xcf,0xf3,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x5b,0xf9,0xfd,0xfe,0xff,0xff,0xff,0xf4,0xf8,0xff,0xff,0xff,0xff,0xff,0xf8,0xe7,0xef,0xef,0xe7,0xf1,0xfc,0xff,0xff,0xcf,0xbf,0xbf,0xc0,0xff,0xff,0xff,0xfc,0xfb,0xf7,0xf7,0xfb,0xfb,0xfd,0xff,0xff,0xf8,0xfd,0xfd,0xfb,0xfb,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xff,//Line 6 |
11 | 0xff,0xff,0xff,0xff,0xf9,0xf6,0xf6,0xfa,0xfa,0xf8,0xff,0xff,0xf8,0xe7,0xef,0xf3,0xfd,0xfc,0xf1,0xff,0xff,0xe0,0xff,0xff,0xff,0xf0,0xfd,0xff,0xff,0xf0,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xcf,0xc3,0xd3,0xe3,0xff,0xff,0xff,0xf7,0xe7,0xee,0xf6,0xf1,0xff,0xff,0xfc,0xf3,0xf7,0xf7,0xfb,0xfb,0xfd,0xff,0xff,0xff,0xcf,0xf3,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x5b,0xf9,0xfd,0xfe,0xff,0xff,0xff,0xf4,0xf8,0xff,0xff,0xff,0xff,0xff,0xf8,0xe7,0xef,0xef,0xe7,0xf1,0xfc,0xff,0xff,0xcf,0xbf,0xbf,0xc0,0xff,0xff,0xff,0xfc,0xfb,0xf7,0xf7,0xfb,0xfb,0xfd,0xff,0xff,0xf8,0xfd,0xfd,0xfb,0xfb,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xff,//Line 6 |
| 11 | 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,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,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,//Line 7 |
12 | 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,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,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,//Line 7 |
| 12 | 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,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,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//Line 7 |
13 | 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,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,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//Line 7 |
| 13 | }; |
14 | }; |
| 14 | 15 | #endif |
|
| 15 | 16 | ||
| 16 | 17 | ||
| 17 | 18 | ||
| 18 | #define SOLID 0 |
19 | #define SOLID 0 |
| 19 | #define TRANSPARENT 1 |
20 | #define TRANSPARENT 1 |
| 20 | uint8_t color=GLCD_COLOR_BLACK; |
21 | uint8_t color=GLCD_COLOR_BLACK; |
| 21 | uint8_t Transparent=SOLID; |
22 | uint8_t Transparent=SOLID; |
| 22 | 23 | ||
| 23 | #if act_ks0108_USE_EXTERNAL_EEPROM==1 |
24 | #if act_ks0108_USE_EXTERNAL_EEPROM==1 |
| 24 | 25 | ||
| 25 | void storeImage(uint8_t id, uint8_t size_x , uint8_t size_y); |
26 | void storeImage(uint8_t id, uint8_t size_x , uint8_t size_y); |
| 26 | 27 | ||
| 27 | void saveImageFromScreen(uint8_t id, uint8_t size_x , uint8_t size_y); |
28 | void saveImageFromScreen(uint8_t id, uint8_t size_x , uint8_t size_y); |
| Line 45... | Line 46... | ||
| 45 | uint16_t address = 0; |
46 | uint16_t address = 0; |
| 46 | uint16_t buf_index = 0; |
47 | uint16_t buf_index = 0; |
| 47 | uint8_t index; |
48 | uint8_t index; |
| 48 | uint8_t size_x = 0; |
49 | uint8_t size_x = 0; |
| 49 | uint8_t size_y = 0; |
50 | uint8_t size_y = 0; |
| 50 | uint16_t max_picture_size; |
51 | uint16_t max_picture_size; |
| 51 | index = (id>>5)&0x07; |
52 | index = (id>>5)&0x07; |
| 52 | //find starting adress of the requested data |
53 | //find starting adress of the requested data |
| 53 | switch (index) { |
54 | switch (index) { |
| 54 | case 0: |
55 | case 0: |
| 55 | address = (index)*1024; |
56 | address = (index)*1024; |
| 56 | max_picture_size = 1024; |
57 | max_picture_size = 1024; |
| 57 | break; |
58 | break; |
| 58 | case 1: |
59 | case 1: |
| 59 | address = 32768+(index)*512; |
60 | address = 32768+(index)*512; |
| 60 | max_picture_size = 512; |
61 | max_picture_size = 512; |
| 61 | break; |
62 | break; |
| 62 | case 2: |
63 | case 2: |
| 63 | address = 32768+32*512+(index)*256; |
64 | address = 32768+32*512+(index)*256; |
| 64 | max_picture_size = 256; |
65 | max_picture_size = 256; |
| 65 | break; |
66 | break; |
| 66 | case 3: |
67 | case 3: |
| 67 | address = 32768+32*512+32*256+(index)*128; |
68 | address = 32768+32*512+32*256+(index)*128; |
| 68 | max_picture_size = 128; |
69 | max_picture_size = 128; |
| 69 | break; |
70 | break; |
| 70 | case 4: |
71 | case 4: |
| 71 | address = 32768+32*512+32*256+32*128+(index)*64; |
72 | address = 32768+32*512+32*256+32*128+(index)*64; |
| 72 | max_picture_size = 64; |
73 | max_picture_size = 64; |
| 73 | break; |
74 | break; |
| 74 | case 5: |
75 | case 5: |
| 75 | address = 32768+32*512+32*256+32*128+32*64+(index)*32; |
76 | address = 32768+32*512+32*256+32*128+32*64+(index)*32; |
| 76 | max_picture_size = 32; |
77 | max_picture_size = 32; |
| 77 | break; |
78 | break; |
| 78 | case 6: |
79 | case 6: |
| 79 | address = 32768+32*512+32*256+32*128+32*64+32*32+(index)*16; |
80 | address = 32768+32*512+32*256+32*128+32*64+32*32+(index)*16; |
| 80 | max_picture_size = 16; |
81 | max_picture_size = 16; |
| 81 | break; |
82 | break; |
| 82 | case 7: |
83 | case 7: |
| Line 86... | Line 87... | ||
| 86 | } |
87 | } |
| 87 | //Get size of picture (every picture has an 4 byte info-tag) |
88 | //Get size of picture (every picture has an 4 byte info-tag) |
| 88 | messageBuf[0] = (MEMORY_I2C_ADDR<<TWI_ADR_BITS); // Read/write bit doesn't matter here |
89 | messageBuf[0] = (MEMORY_I2C_ADDR<<TWI_ADR_BITS); // Read/write bit doesn't matter here |
| 89 | messageBuf[1] = (uint8_t)(0); // Starting address in memory |
90 | messageBuf[1] = (uint8_t)(0); // Starting address in memory |
| 90 | messageBuf[2] = (uint8_t)(((id&0xe0)>>5) & 0xff); // Starting address in memory |
91 | messageBuf[2] = (uint8_t)(((id&0xe0)>>5) & 0xff); // Starting address in memory |
| 91 | TWI_Start_Random_Read( messageBuf, 129, 3 ); // Desired data length plus one (command byte). |
92 | TWI_Start_Random_Read( messageBuf, 129, 3 ); // Desired data length plus one (command byte). |
| 92 | // Could do other actions in here, then get data. |
93 | // Could do other actions in here, then get data. |
| 93 | TWI_Read_Data_From_Buffer( messageBuf, 129 ); |
94 | TWI_Read_Data_From_Buffer( messageBuf, 129 ); |
| 94 | size_x = messageBuf[((id&0x1f)<<2)]; |
95 | size_x = messageBuf[((id&0x1f)<<2)]; |
| 95 | size_y = messageBuf[((id&0x1f)<<2)+1]; |
96 | size_y = messageBuf[((id&0x1f)<<2)+1]; |
| 96 | //more_data = messageBuf[((id&0x1f)<<2)+2]; |
97 | //more_data = messageBuf[((id&0x1f)<<2)+2]; |
| 97 | //last_data = messageBuf[((id&0x1f)<<2)+3]; |
98 | //last_data = messageBuf[((id&0x1f)<<2)+3]; |
| 98 | 99 | ||
| 99 | // get data from eeprom |
100 | // get data from eeprom |
| 100 | messageBuf[0] = (MEMORY_I2C_ADDR<<TWI_ADR_BITS); // Read/write bit doesn't matter here |
101 | messageBuf[0] = (MEMORY_I2C_ADDR<<TWI_ADR_BITS); // Read/write bit doesn't matter here |
| 101 | messageBuf[1] = (uint8_t)((address >> 8) & 0xff); // Starting address in memory |
102 | messageBuf[1] = (uint8_t)((address >> 8) & 0xff); // Starting address in memory |
| 102 | messageBuf[2] = (uint8_t)(address & 0xff); // Starting address in memory |
103 | messageBuf[2] = (uint8_t)(address & 0xff); // Starting address in memory |
| 103 | TWI_Start_Random_Read( messageBuf, 129, 3 ); // Desired data length plus one (command byte). |
104 | TWI_Start_Random_Read( messageBuf, 129, 3 ); // Desired data length plus one (command byte). |
| 104 | // Could do other actions in here, then get data. |
105 | // Could do other actions in here, then get data. |
| 105 | TWI_Read_Data_From_Buffer( messageBuf, 129 ); |
106 | TWI_Read_Data_From_Buffer( messageBuf, 129 ); |
| 106 | uint8_t jy = 0; |
107 | uint8_t jy = 0; |
| 107 | uint8_t jx = 0; |
108 | uint8_t jx = 0; |
| 108 | buf_index = 0; |
109 | buf_index = 0; |
| 109 | for (jy = 0; jy< size_y; jy+=8){ |
110 | for (jy = 0; jy< size_y; jy+=8){ |
| 110 | glcdSetXY(x_start,y_start+jy); |
111 | glcdSetXY(x_start,y_start+jy); |
| Line 118... | Line 119... | ||
| 118 | // Could do other actions in here, then get data. |
119 | // Could do other actions in here, then get data. |
| 119 | TWI_Read_Data_From_Buffer( messageBuf, 129 ); |
120 | TWI_Read_Data_From_Buffer( messageBuf, 129 ); |
| 120 | buf_index=0; |
121 | buf_index=0; |
| 121 | } |
122 | } |
| 122 | glcdWriteData(messageBuf[buf_index+1], GLCD_COLOR_CLEAR); |
123 | glcdWriteData(messageBuf[buf_index+1], GLCD_COLOR_CLEAR); |
| 123 | buf_index++; |
124 | buf_index++; |
| 124 | } |
125 | } |
| 125 | } |
126 | } |
| 126 | } |
127 | } |
| 127 | volatile uint8_t state; |
128 | volatile uint8_t state; |
| 128 | volatile uint8_t lastId = 255; |
129 | volatile uint8_t lastId = 255; |
| 129 | #define IDLE 0 |
130 | #define IDLE 0 |
| 130 | #define RECEIVING_DATA 1 |
131 | #define RECEIVING_DATA 1 |
| 131 | void newImageData(StdCan_Msg_t *rxMsg) { |
132 | void newImageData(StdCan_Msg_t *rxMsg) { |
| Line 135... | Line 136... | ||
| 135 | if (rxMsg->Header.Command == CAN_MODULE_CMD_KS0108_LCD_NEW_IMAGE) |
136 | if (rxMsg->Header.Command == CAN_MODULE_CMD_KS0108_LCD_NEW_IMAGE) |
| 136 | { |
137 | { |
| 137 | storeImage(rxMsg->Data[0],rxMsg->Data[1],rxMsg->Data[2]); |
138 | storeImage(rxMsg->Data[0],rxMsg->Data[1],rxMsg->Data[2]); |
| 138 | state = RECEIVING_DATA; |
139 | state = RECEIVING_DATA; |
| 139 | lastId = 255; |
140 | lastId = 255; |
| 140 | //response message |
141 | //response message |
| 141 | rxMsg->Length = 1; |
142 | rxMsg->Length = 1; |
| 142 | rxMsg->Header.Command = CAN_MODULE_CMD_KS0108_LCD_ACK; |
143 | rxMsg->Header.Command = CAN_MODULE_CMD_KS0108_LCD_ACK; |
| 143 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
144 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
| 144 | }else { |
145 | }else { |
| 145 | //error message |
146 | //error message |
| 146 | rxMsg->Length = 0; |
147 | rxMsg->Length = 0; |
| 147 | rxMsg->Header.Command = CAN_MODULE_CMD_KS0108_LCD_ERROR; |
148 | rxMsg->Header.Command = CAN_MODULE_CMD_KS0108_LCD_ERROR; |
| 148 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
149 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
| 149 | } |
150 | } |
| 150 | break; |
151 | break; |
| 151 | case RECEIVING_DATA: |
152 | case RECEIVING_DATA: |
| 152 | if (rxMsg->Header.Command == CAN_MODULE_CMD_KS0108_LCD_IMAGE_DATA) |
153 | if (rxMsg->Header.Command == CAN_MODULE_CMD_KS0108_LCD_IMAGE_DATA) |
| Line 177... | Line 178... | ||
| 177 | //error message |
178 | //error message |
| 178 | rxMsg->Length = 0; |
179 | rxMsg->Length = 0; |
| 179 | rxMsg->Header.Command = CAN_MODULE_CMD_KS0108_LCD_ERROR; |
180 | rxMsg->Header.Command = CAN_MODULE_CMD_KS0108_LCD_ERROR; |
| 180 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
181 | while (StdCan_Put(rxMsg) != StdCan_Ret_OK); |
| 181 | } |
182 | } |
| 182 | break; |
183 | break; |
| 183 | } |
184 | } |
| 184 | 185 | ||
| 185 | } |
186 | } |
| 186 | 187 | ||
| 187 | 188 | ||
| 188 | //valid id is 1 to 255; |
189 | //valid id is 1 to 255; |
| Line 289... | Line 290... | ||
| 289 | TWI_Start_Read_Write( messageBuf, 131 ); |
290 | TWI_Start_Read_Write( messageBuf, 131 ); |
| 290 | // Should wait for completion of EEPROM write cycle. Blinking the LED will do this. |
291 | // Should wait for completion of EEPROM write cycle. Blinking the LED will do this. |
| 291 | while ( TWI_Transceiver_Busy() ); // Check for an error. |
292 | while ( TWI_Transceiver_Busy() ); // Check for an error. |
| 292 | 293 | ||
| 293 | //Now the info-tag is written, only to add data left |
294 | //Now the info-tag is written, only to add data left |
| 294 | uint8_t h, i ; |
295 | uint8_t h, i ; |
| 295 | 296 | ||
| 296 | 297 | ||
| 297 | messageBuf[0] = (MEMORY_I2C_ADDR<<TWI_ADR_BITS) | (FALSE<<TWI_READ_BIT); |
298 | messageBuf[0] = (MEMORY_I2C_ADDR<<TWI_ADR_BITS) | (FALSE<<TWI_READ_BIT); |
| 298 | messageBuf[1] = (uint8_t)((address >> 8) & 0xff); // Starting address in memory |
299 | messageBuf[1] = (uint8_t)((address >> 8) & 0xff); // Starting address in memory |
| 299 | messageBuf[2] = (uint8_t)(address & 0xff); // Starting address in memory |
300 | messageBuf[2] = (uint8_t)(address & 0xff); // Starting address in memory |
| Line 420... | Line 421... | ||
| 420 | #endif |
421 | #endif |
| 421 | 422 | ||
| 422 | glcdInit(); |
423 | glcdInit(); |
| 423 | 424 | ||
| 424 | #if act_ks0108_USE_EXTERNAL_EEPROM==0 |
425 | #if act_ks0108_USE_EXTERNAL_EEPROM==0 |
| - | 426 | #if GRAPHICS_DRIVER!=DOTMATRIX |
|
| 425 | uint16_t ixa = 0; |
427 | uint16_t ixa = 0; |
| 426 | uint8_t jxa = 0; |
428 | uint8_t jxa = 0; |
| 427 | for (jxa = 0; jxa< 8; jxa++){ |
429 | for (jxa = 0; jxa< 8; jxa++){ |
| 428 | glcdSetXY(0,jxa*8); |
430 | glcdSetXY(0,jxa*8); |
| 429 | for (ixa = 0; ixa < 128; ixa++){ |
431 | for (ixa = 0; ixa < 128; ixa++){ |
| 430 | glcdWriteData((uint8_t)pgm_read_byte((uint16_t)&Splash_left+ixa+jxa*128), GLCD_COLOR_CLEAR); |
432 | glcdWriteData((uint8_t)pgm_read_byte((uint16_t)&Splash_left+ixa+jxa*128), GLCD_COLOR_CLEAR); |
| 431 | } |
433 | } |
| 432 | } |
434 | } |
| - | 435 | #endif |
|
| 433 | #endif |
436 | #endif |
| 434 | 437 | ||
| 435 | #if act_ks0108_USE_EXTERNAL_EEPROM==1 |
438 | #if act_ks0108_USE_EXTERNAL_EEPROM==1 |
| 436 | printImage(1,0,0); |
439 | printImage(1,0,0); |
| 437 | //delay 10ms |
440 | //delay 10ms |
| 438 | temp2 =Timer_GetTicks(); |
441 | temp2 =Timer_GetTicks(); |
| 439 | while (Timer_GetTicks() < temp2 + 5000); |
442 | while (Timer_GetTicks() < temp2 + 5000); |
| 440 | printImage(0,0,0); |
443 | printImage(0,0,0); |
| 441 | #endif |
444 | #endif |
| 442 | //glcdSetXY(0,0); |
445 | //glcdSetXY(0,0); |
| 443 | //glcdPutStrTransparent("=_-[]_-=",GLCD_COLOR_SET); |
446 | //glcdPutStrTransparent("=_-[]_-=",GLCD_COLOR_SET); |
| 444 | //glcdSetXY(0,8); |
447 | //glcdSetXY(0,8); |
| 445 | //glcdPutStrTransparent("--------",GLCD_COLOR_SET); |
448 | //glcdPutStrTransparent("--------",GLCD_COLOR_SET); |
| 446 | //glcdSetXY(0,16); |
449 | //glcdSetXY(0,16); |
| Line 450... | Line 453... | ||
| 450 | //glcdFillRect(90, 10, 20, 20, GLCD_COLOR_SET); |
453 | //glcdFillRect(90, 10, 20, 20, GLCD_COLOR_SET); |
| 451 | //glcdInvertRect(28, 10, 20, 20); |
454 | //glcdInvertRect(28, 10, 20, 20); |
| 452 | //glcdInvert(); |
455 | //glcdInvert(); |
| 453 | //glcdDrawRoundRect(85, 5, 30, 30, 5, GLCD_COLOR_SET); |
456 | //glcdDrawRoundRect(85, 5, 30, 30, 5, GLCD_COLOR_SET); |
| 454 | //glcdDrawCircle(64, 32, 10, 1); |
457 | //glcdDrawCircle(64, 32, 10, 1); |
| - | 458 | #if GRAPHICS_DRIVER==DOTMATRIX |
|
| - | 459 | glcdSetXY(5,0); |
|
| - | 460 | glcdPutStrTransparent("auml",GLCD_COLOR_SET); |
|
| - | 461 | glcdSetXY(1,8); |
|
| - | 462 | glcdPutStrTransparent(" .se",GLCD_COLOR_SET); |
|
| - | 463 | #else |
|
| 455 | glcdSetXY(87,8); |
464 | glcdSetXY(87,8); |
| 456 | glcdPutStrTransparent("Home-",GLCD_COLOR_SET); |
465 | glcdPutStrTransparent("Home-",GLCD_COLOR_SET); |
| 457 | glcdSetXY(80,16); |
466 | glcdSetXY(80,16); |
| 458 | glcdPutStrTransparent("Automa-",GLCD_COLOR_SET); |
467 | glcdPutStrTransparent("Automa-",GLCD_COLOR_SET); |
| 459 | glcdSetXY(91,24); |
468 | glcdSetXY(91,24); |
| 460 | glcdPutStrTransparent("ion",GLCD_COLOR_SET); |
469 | glcdPutStrTransparent("ion",GLCD_COLOR_SET); |
| 461 | //glcdDrawLine(10, 62, 50, 5, GLCD_COLOR_CLEAR); |
470 | //glcdDrawLine(10, 62, 50, 5, GLCD_COLOR_CLEAR); |
| 462 | 471 | #endif |
|
| 463 | } |
472 | } |
| 464 | 473 | ||
| 465 | void act_ks0108_Process(void) |
474 | void act_ks0108_Process(void) |
| 466 | { |
475 | { |
| 467 | ///TODO: Stuff that needs doing is done here |
476 | ///TODO: Stuff that needs doing is done here |