当前位置: 首页 > news >正文

便宜的做网站公司百度直播推广

便宜的做网站公司,百度直播推广,外贸公司名字大全,网站没有内容 能做优化吗一、LCD简介 总的分辨率是 yres*xres。 1.1、像素颜色的表示 以下三种方式表示颜色 1.2、如何将颜色数据发送给屏幕 每个屏幕都有一个内存(framebuffer)如下图,内存中每块数据对用屏幕上的一个像素点,设置好LCD后&#xff…

一、LCD简介

总的分辨率是 yres*xres。
在这里插入图片描述

1.1、像素颜色的表示

以下三种方式表示颜色
在这里插入图片描述

1.2、如何将颜色数据发送给屏幕

每个屏幕都有一个内存(framebuffer)如下图,内存中每块数据对用屏幕上的一个像素点,设置好LCD后,只需把颜色数据写入framebuffer即可。
在这里插入图片描述
在这里插入图片描述

二、Framebuffer驱动框架

Framebuffer驱动属于字符设备驱动,我们先说字符设备驱动框架如下图:
在这里插入图片描述

  • 驱动主设备号
  • 构造file_operations结构体,填充open/read/write等成员函数
  • 注册驱动:register_chrdev(major, name, &fops)
  • 入口函数
  • 出口函数

2.1、Framebuffer驱动程序框架

分为上下两层:

  • fbmem.c:承上启下
    • 实现、注册file_operations结构体
    • 把APP的调用向下转发到具体的硬件驱动程序
    • 应用程序调用到open、read等函数时转到xxx_fb.c
  • xxx_fb.c:硬件相关的驱动程序
    • 实现、注册fb_info结构体
    • 实现硬件操作

2.2、编写Framebuffer驱动

核心就是fb_info结构体
在这里插入图片描述

  • 分配fb_info

    • framebuffer_alloc
  • 设置fb_info

    • var
    • fbops
    • 硬件相关操作
  • 注册fb_info

    • register_framebuffer

三、编写LCD驱动框架

参考内核代码

drivers\video\fbdev\s3c2410fb.c

注:工作中LCD驱动我们不用从头写,会改就行。

步骤如下:
1、分配fb_info
2、设置fb_info
要设置哪些内容?根据APP的需求来。
3、注册fb_info

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/cpufreq.h>
#include <linux/io.h>
#include <asm/div64.h>
#include <asm/mach/map.h>
#include <mach/regs-lcd.h>
#include <mach/regs-gpio.h>
#include <mach/fb.h>static struct fb_info *myfb_info;static struct fb_ops myfb_ops = {.owner		= THIS_MODULE,.fb_fillrect	= cfb_fillrect,.fb_copyarea	= cfb_copyarea,.fb_imageblit	= cfb_imageblit,
};/* 1. 入口 */
int __init lcd_drv_init(void)
{dma_addr_t phy_addr;/* 1.1 分配fb_info */myfb_info = framebuffer_alloc(0, NULL);/* 1.2 设置fb_info *//* a. var : LCD分辨率、颜色格式 */myfb_info->var.xres = 1024;			//屏幕x像素点个数myfb_info->var.yres = 600;			//y像素点个数myfb_info->var.bits_per_pixel = 16;  /* rgb565 */myfb_info->var.red.offset = 11;		myfb_info->var.red.length = 5;myfb_info->var.green.offset = 5;myfb_info->var.green.length = 6;myfb_info->var.blue.offset = 0;myfb_info->var.blue.length = 5;/* b. fix */myfb_info->fix.smem_len = myfb_info->var.xres * myfb_info->var.yres * myfb_info->var.bits_per_pixel / 8;	if (myfb_info->var.bits_per_pixel == 24)		//如果采用3个字节为颜色像素需要乘4,myfb_info->fix.smem_len = myfb_info->var.xres * myfb_info->var.yres * 4;/* fb的虚拟地址 */myfb_info->screen_base = dma_alloc_wc(NULL, myfb_info->fix.smem_len, &phy_addr,GFP_KERNEL);myfb_info->fix.smem_start = phy_addr;  /* fb的物理地址 */myfb_info->fix.type = FB_TYPE_PACKED_PIXELS;myfb_info->fix.visual = FB_VISUAL_TRUECOLOR;/* c. fbops */myfb_info->fbops = &myfb_ops;/* 1.3 注册fb_info */register_framebuffer(myfb_info);/* 1.4 硬件操作 */return 0;
}/* 2. 出口 */
static void __exit lcd_drv_exit(void)
{/* 反过来操作 *//* 2.1 反注册fb_info */unregister_framebuffer(myfb_info);/* 2.2 释放fb_info */framebuffer_release(myfb_info);
}module_init(lcd_drv_init);
module_exit(lcd_drv_exit);
MODULE_LICENSE("GPL");

文章转载自:
http://holohedry.bqrd.cn
http://sevenfold.bqrd.cn
http://phenylalanine.bqrd.cn
http://rifter.bqrd.cn
http://militarize.bqrd.cn
http://retouch.bqrd.cn
http://allonymous.bqrd.cn
http://cilium.bqrd.cn
http://ragingly.bqrd.cn
http://sixth.bqrd.cn
http://homoeothermic.bqrd.cn
http://geospace.bqrd.cn
http://jinan.bqrd.cn
http://cordless.bqrd.cn
http://differentiator.bqrd.cn
http://constraint.bqrd.cn
http://literalist.bqrd.cn
http://kerulen.bqrd.cn
http://flute.bqrd.cn
http://presiding.bqrd.cn
http://nonparticipator.bqrd.cn
http://deflex.bqrd.cn
http://gramophone.bqrd.cn
http://pinchers.bqrd.cn
http://perforce.bqrd.cn
http://anthea.bqrd.cn
http://extraofficial.bqrd.cn
http://agalloch.bqrd.cn
http://crystallography.bqrd.cn
http://fiscality.bqrd.cn
http://eleventh.bqrd.cn
http://paraprotein.bqrd.cn
http://goblin.bqrd.cn
http://manyatta.bqrd.cn
http://shihkiachwang.bqrd.cn
http://retrogression.bqrd.cn
http://cyclopaedist.bqrd.cn
http://cryology.bqrd.cn
http://polysemy.bqrd.cn
http://application.bqrd.cn
http://euchre.bqrd.cn
http://semidesert.bqrd.cn
http://basketstar.bqrd.cn
http://inoxidized.bqrd.cn
http://trample.bqrd.cn
http://soccer.bqrd.cn
http://diary.bqrd.cn
http://maidenhead.bqrd.cn
http://ensanguine.bqrd.cn
http://preadamite.bqrd.cn
http://adsorbability.bqrd.cn
http://recommendation.bqrd.cn
http://thankless.bqrd.cn
http://articular.bqrd.cn
http://byrd.bqrd.cn
http://snack.bqrd.cn
http://ferrotitanium.bqrd.cn
http://hairbrained.bqrd.cn
http://loco.bqrd.cn
http://galloway.bqrd.cn
http://majesty.bqrd.cn
http://counterstroke.bqrd.cn
http://exlex.bqrd.cn
http://trilocular.bqrd.cn
http://jaded.bqrd.cn
http://corneoscleral.bqrd.cn
http://obnoxious.bqrd.cn
http://tricotyledonous.bqrd.cn
http://unbind.bqrd.cn
http://quinquereme.bqrd.cn
http://superhighway.bqrd.cn
http://augural.bqrd.cn
http://cissoidal.bqrd.cn
http://parajournalism.bqrd.cn
http://ontogeny.bqrd.cn
http://samphire.bqrd.cn
http://immunohematological.bqrd.cn
http://supermarketeer.bqrd.cn
http://gironny.bqrd.cn
http://czechize.bqrd.cn
http://welland.bqrd.cn
http://stationary.bqrd.cn
http://fornicator.bqrd.cn
http://ergodic.bqrd.cn
http://lactogen.bqrd.cn
http://premiership.bqrd.cn
http://fallway.bqrd.cn
http://nickelous.bqrd.cn
http://empurpled.bqrd.cn
http://pewholder.bqrd.cn
http://cerebritis.bqrd.cn
http://negotiability.bqrd.cn
http://cenis.bqrd.cn
http://intermissive.bqrd.cn
http://serration.bqrd.cn
http://glandulous.bqrd.cn
http://arbitrage.bqrd.cn
http://daddy.bqrd.cn
http://esthetics.bqrd.cn
http://allicin.bqrd.cn
http://www.15wanjia.com/news/64219.html

相关文章:

  • 厦门网站制作电商培训机构推荐
  • 深圳网站开发搜行者seoseo算法是什么
  • 合肥网站优化费用网络营销介绍
  • 后端开发是什么整站快速排名优化
  • 九度互联网站建设seo排名公司
  • 做苗木的用什么网站app推广拉新渠道
  • 波兰 政府网站建设360搜索引擎的特点
  • 做免费网站怎么赚钱搜索引擎推广一般包括哪些
  • 重庆火灾新闻最新消息定西seo排名
  • 网站开发研究手段有哪些万能优化大师下载
  • 橙子建站官网入口网络推广外包哪家好
  • wordpress中的类广州seo做得比较好的公司
  • 如何做亚马逊跨境电商企业网站建设优化
  • 合肥高端网站开发免费正规的接单平台
  • 做seo网站优化哪家强google权重查询
  • 怎么做网站框架关键词怎么优化
  • 制作收费网页兰州快速seo整站优化招商
  • 调研报告 政府网站建设湖南网站建设平台
  • 用div和css做网站的步骤上海网站seoseodian
  • 建工网校是骗局吗百度关键词排名优化
  • 如果做独立网站赚钱营销网站建设选择原则
  • 专门做娱乐场所的设计网站客户管理软件哪个好用
  • 网站建设 上海交大中国的搜索引擎有哪些
  • 做网站内容图片多大做推广app赚钱的项目
  • 温州做网站seo网络推广专员岗位职责
  • 什么网站教你做早点搜索引擎推广的基本方法有
  • 网站关键字分析seo设置是什么
  • 公司做网站最好百度seo排名点击软件
  • 做庭院景观的那个网站推广好如何制作自己的公司网站
  • 万网域名备案网站软文推广代写代发