Skip to content

screen: 关于使用rgb565格式刷新ST7789屏幕,rgb565的格式问题 #181

@lijunru-hub

Description

@lijunru-hub

因为ST7789仅支持RGB565格式的图像,做项目时需要显示灰度图像。再多次尝试后,发现以下问题:

使用RGB565标准格式进行灰度转RGB565时
企业微信截图_16500090742202
图像有问题

应按照下图进行转码
企业微信截图_16500263909742

附上GREY转RGB565的代码

static uint16_t gray_to_565(uint8_t r, uint8_t g, uint8_t b)
{
    return ((uint16_t)((r & 0xF8) | ((b & 0xF8) << 5) | ((g & 0x1c) << 11) | ((g & 0xE0) >> 5)));
}

希望官方能补充该部分的文档,或者提供彩屏显示灰度的驱动

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions