Mercurial > louis > kiibohd-controller
comparison Scan/STLcd/lcd_scan.c @ 332:2e0074f75855
Adding example logo to the lcdtest and bmp conversion script.
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sat, 18 Apr 2015 11:24:15 -0700 |
parents | 9e31d92caf12 |
children | 136e47478441 |
comparison
equal
deleted
inserted
replaced
331:9e31d92caf12 | 332:2e0074f75855 |
---|---|
30 | 30 |
31 | 31 |
32 // ----- Defines ----- | 32 // ----- Defines ----- |
33 | 33 |
34 #define LCD_TOTAL_VISIBLE_PAGES 4 | 34 #define LCD_TOTAL_VISIBLE_PAGES 4 |
35 #define LCD_PAGE_LEN 132 | 35 #define LCD_PAGE_LEN 128 |
36 | 36 |
37 | 37 |
38 | 38 |
39 // ----- Macros ----- | 39 // ----- Macros ----- |
40 | 40 |
156 void LCD_writeDisplayReg( uint8_t page, uint8_t *buffer, uint8_t len ) | 156 void LCD_writeDisplayReg( uint8_t page, uint8_t *buffer, uint8_t len ) |
157 { | 157 { |
158 // Set the register page | 158 // Set the register page |
159 LCD_writeControlReg( 0xB0 | ( 0x0F & page ) ); | 159 LCD_writeControlReg( 0xB0 | ( 0x0F & page ) ); |
160 | 160 |
161 // Set display start line | |
162 LCD_writeControlReg( 0x40 ); | |
163 | |
164 // Reset Column Address | |
165 LCD_writeControlReg( 0x10 ); | |
166 LCD_writeControlReg( 0x00 ); | |
167 | |
161 // Write buffer to SPI | 168 // Write buffer to SPI |
162 SPI_write( buffer, len ); | 169 SPI_write( buffer, len ); |
163 } | 170 } |
164 | 171 |
165 inline void LCD_clearPage( uint8_t page ) | 172 inline void LCD_clearPage( uint8_t page ) |
293 print( NL ); // No \r\n by default after the command is entered | 300 print( NL ); // No \r\n by default after the command is entered |
294 | 301 |
295 //LCD_initialize(); | 302 //LCD_initialize(); |
296 // Test pattern | 303 // Test pattern |
297 uint8_t pattern[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | 304 uint8_t pattern[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; |
305 | |
306 | |
307 uint8_t logo[] = { | |
308 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
309 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
310 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
311 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
312 }; | |
298 //uint8_t pattern[] = { 0xFF, 0x00, 0x96, 0xFF, 0x00, 0xFF, 0x00 }; | 313 //uint8_t pattern[] = { 0xFF, 0x00, 0x96, 0xFF, 0x00, 0xFF, 0x00 }; |
299 | 314 |
300 // Write to page D0 | 315 // Write to page D0 |
301 LCD_writeDisplayReg( 0, pattern, sizeof( pattern ) ); | 316 //LCD_writeDisplayReg( 0, pattern, sizeof( pattern ) ); |
317 | |
318 for ( uint8_t page = 0; page < LCD_TOTAL_VISIBLE_PAGES; page++ ) | |
319 { | |
320 LCD_writeDisplayReg( page, &logo[page * LCD_PAGE_LEN], LCD_PAGE_LEN ); | |
321 } | |
302 } | 322 } |
303 | 323 |
304 void cliFunc_lcdCmd( char* args ) | 324 void cliFunc_lcdCmd( char* args ) |
305 { | 325 { |
306 char* curArgs; | 326 char* curArgs; |