esp_lcd_panel_draw_bitmap填充颜色不正确

_CunJiang
Posts: 2
Joined: Sat May 13, 2023 8:10 am

esp_lcd_panel_draw_bitmap填充颜色不正确

Postby _CunJiang » Tue Aug 06, 2024 2:13 pm

我初始化st7789的屏幕后想用esp_lcd_panel_draw_bitmap对屏幕填充颜色,请问为什么不能通过直接发送颜色地址来填充,而需要拆开来才能正确显示颜色?
  1. uint16_t color=RED;// #define RED                0xF800
  2. uint8_t buf[2]={color>>8,color};
  3. uint16_t test_buf[1]={color};
  4. for(uint16_t y=0;y<LCD_H;y++) {
  5. for (uint16_t x=0;x<LCD_W;x++) {
  6.             //esp_lcd_panel_draw_bitmap(lcd_panel,x,y,x+1,y+1,&color);   //  显示 蓝色
  7.             esp_lcd_panel_draw_bitmap(lcd_panel,x,y,x+1,y+1,buf);          //  显示 红色
  8.         }
  9.     }

_CunJiang
Posts: 2
Joined: Sat May 13, 2023 8:10 am

Re: esp_lcd_panel_draw_bitmap填充颜色不正确

Postby _CunJiang » Wed Aug 07, 2024 5:56 am

我查看源码后了解到里边是用了esp_lcd_panel_io_tx_color(io, LCD_CMD_RAMWR, color_data, len),有没有什么办法能直接发uint16_t数据的地址而不用拆开来?

Who is online

Users browsing this forum: No registered users and 127 guests