Changeset 364 for asp3_tinet_ecnl_arm/trunk/asp3_dcre/gdic
- Timestamp:
- Feb 1, 2019, 9:57:09 PM (5 years ago)
- Location:
- asp3_tinet_ecnl_arm/trunk/asp3_dcre/gdic
- Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/asp3_dcre/gdic/adafruit_st7735/adafruit_st7735.c
r352 r364 354 354 355 355 /* 356 * LCDへのRGBデータ送信関数 357 */ 358 ER 359 lcd_writedata4(LCD_Handler_t *hlcd, uint8_t *pbmp, uint16_t width, uint16_t height) 360 { 361 ER ercd = E_OK; 362 int index, i; 363 364 if(width == 0 || height == 0) 365 return ercd; 366 if(hlcd->spi_lock != 0){ 367 if((ercd = wai_sem(hlcd->spi_lock)) != E_OK) 368 return ercd; 369 } 370 rs_set(PORT_HIGH); 371 cs_set(PORT_LOW); 372 //dly_tsk(100/*us*/); 373 for(index=0; index < height; index++){ 374 uint8_t *p = pbmp; 375 for (i = 0; i < width; i++){ 376 spi_master_write(&hlcd->hspi, *p++); 377 spi_master_write(&hlcd->hspi, *p++); 378 } 379 pbmp -= width*2; 380 } 381 //dly_tsk(100/*us*/); 382 cs_set(PORT_HIGH); 383 if(hlcd->spi_lock != 0) 384 sig_sem(hlcd->spi_lock); 385 return ercd; 386 } 387 388 /* 356 389 * ST7735へのコマンドリスト送信 357 390 */ … … 590 623 lcd_setAddrWindow(hlcd, x0, y0, x0+width-1, y0+height-1); 591 624 lcd_writedata3(hlcd, pbmp, width, height); 625 } 626 627 void 628 lcd_drawImage(LCD_Handler_t *hlcd, uint16_t x0, uint16_t y0, int16_t w, int16_t h, uint8_t *pbmp) 629 { 630 lcd_setAddrWindow(hlcd, x0, y0, x0+w-1, y0+h-1); 631 pbmp += w * (h - 1) * 3; 632 lcd_writedata3(hlcd, pbmp, w, h); 592 633 } 593 634 -
asp3_tinet_ecnl_arm/trunk/asp3_dcre/gdic/adafruit_st7735/adafruit_st7735.h
r352 r364 59 59 #endif 60 60 61 #include <stdbool.h> 61 62 #include "device.h" 62 63 #include "pinmap.h" … … 145 146 #ifndef TOPPERS_MACRO_ONLY 146 147 148 typedef struct GFXfont GFXfont; 149 147 150 /* 148 151 * LCDハンドラ構造体定義 … … 153 156 uint16_t _width; /* 幅ピクセル数 */ 154 157 uint16_t _height; /* 高さピクセル数 */ 158 int16_t cursor_x, cursor_y; 159 uint16_t textcolor, textbgcolor; 160 uint8_t textsize, rotation; 161 bool wrap; 162 GFXfont *gfxFont; 155 163 uint8_t colstart; 156 164 uint8_t rowstart; … … 188 196 extern ER lcd_writedata2(LCD_Handler_t *hlcd, uint16_t c, int cnt); 189 197 extern ER lcd_writedata3(LCD_Handler_t *hlcd, uint8_t *pbmp, uint16_t width, uint16_t height); 198 extern ER lcd_writedata4(LCD_Handler_t *hlcd, uint8_t *pbmp, uint16_t width, uint16_t height); 190 199 191 200 extern void lcd_initB(LCD_Handler_t *hlcd); … … 198 207 extern void lcd_drawFastHLine(LCD_Handler_t *hlcd, int16_t x, int16_t y, int16_t w, uint16_t color); 199 208 extern void lcd_drawBitmap(LCD_Handler_t *hlcd, uint16_t x0, uint16_t y0, uint8_t *pbmp); 209 extern void lcd_drawImage(LCD_Handler_t *hlcd, uint16_t x0, uint16_t y0, int16_t w, int16_t h, uint8_t *pbmp); 200 210 extern void lcd_invertDisplay(LCD_Handler_t *hlcd, bool_t i); 201 211
Note:
See TracChangeset
for help on using the changeset viewer.