方法1:
static u16 Rgb555_Rgb565_M(u16 arg)
{
u16 color;
color|=(arg&0x7c00)<<1;//r
color|=(arg&0x03e0)<<1;//g
color|=(arg&0x001f)//b
return color;
}
方法2:
static u16 Rgb555_Rgb565(u16 arg)
{
char c1 =arg>>8;
char c2 = arg&0xff;
char c3,c4;
c3= c1<<1;
c3|= c2>>7;
c4 = c2<<1;
c4&= 0xc0;
c4|= c2&0x1f;
if(c2&0x20) c4+=0x20;
u16 color = (c3<<8) | c4; // rrrr rggg(c3) gggb bbbb(c4) RGB565
return color;
}