- Timestamp:
- Feb 1, 2019, 9:57:09 PM (5 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.