本文主要是介绍LCD液晶屏驱动详解(5),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
- 调色板相关函数设置
- 为了兼容性,我们要先定义一个伪调色板数组,
static u32 pseudo_palette[16];
- 设置颜色填充函数
/* from pxafb.c */
static inline unsigned int chan_to_field(unsigned int chan, struct fb_bitfield *bf)
{chan &= 0xffff;chan >>= 16 - bf->length;return chan << bf->offset;
}
- 设置调色板
static int s3c_lcdfb_setcolreg(unsigned int regno, unsigned int red,unsigned int green, unsigned int blue,unsigned int transp, struct fb_info *info)
{unsigned int val;if (regno > 16)return 1;/* 用red,green,blue三原色构造出val */val = chan_to_field(red, &info->var.red);val |= chan_to_field(green, &info->var.green);val |= chan_to_field(blue, &info->var.blue);//((u32 *)(info->pseu
这篇关于LCD液晶屏驱动详解(5)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!