国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

便宜的做網(wǎng)站公司關(guān)鍵詞seo公司推薦

便宜的做網(wǎng)站公司,關(guān)鍵詞seo公司推薦,外貿(mào)銷售模式,廣東省網(wǎng)站建設(shè)公司排名一、LCD簡介 總的分辨率是 yres*xres。 1.1、像素顏色的表示 以下三種方式表示顏色 1.2、如何將顏色數(shù)據(jù)發(fā)送給屏幕 每個(gè)屏幕都有一個(gè)內(nèi)存(framebuffer)如下圖,內(nèi)存中每塊數(shù)據(jù)對用屏幕上的一個(gè)像素點(diǎn),設(shè)置好LCD后&#xff…

一、LCD簡介

總的分辨率是 yres*xres。
在這里插入圖片描述

1.1、像素顏色的表示

以下三種方式表示顏色
在這里插入圖片描述

1.2、如何將顏色數(shù)據(jù)發(fā)送給屏幕

每個(gè)屏幕都有一個(gè)內(nèi)存(framebuffer)如下圖,內(nèi)存中每塊數(shù)據(jù)對用屏幕上的一個(gè)像素點(diǎn),設(shè)置好LCD后,只需把顏色數(shù)據(jù)寫入framebuffer即可。
在這里插入圖片描述
在這里插入圖片描述

二、Framebuffer驅(qū)動(dòng)框架

Framebuffer驅(qū)動(dòng)屬于字符設(shè)備驅(qū)動(dòng),我們先說字符設(shè)備驅(qū)動(dòng)框架如下圖:
在這里插入圖片描述

  • 驅(qū)動(dòng)主設(shè)備號
  • 構(gòu)造file_operations結(jié)構(gòu)體,填充open/read/write等成員函數(shù)
  • 注冊驅(qū)動(dòng):register_chrdev(major, name, &fops)
  • 入口函數(shù)
  • 出口函數(shù)

2.1、Framebuffer驅(qū)動(dòng)程序框架

分為上下兩層:

  • fbmem.c:承上啟下
    • 實(shí)現(xiàn)、注冊file_operations結(jié)構(gòu)體
    • 把APP的調(diào)用向下轉(zhuǎn)發(fā)到具體的硬件驅(qū)動(dòng)程序
    • 應(yīng)用程序調(diào)用到open、read等函數(shù)時(shí)轉(zhuǎn)到xxx_fb.c
  • xxx_fb.c:硬件相關(guān)的驅(qū)動(dòng)程序
    • 實(shí)現(xiàn)、注冊fb_info結(jié)構(gòu)體
    • 實(shí)現(xiàn)硬件操作

2.2、編寫Framebuffer驅(qū)動(dòng)

核心就是fb_info結(jié)構(gòu)體
在這里插入圖片描述

  • 分配fb_info

    • framebuffer_alloc
  • 設(shè)置fb_info

    • var
    • fbops
    • 硬件相關(guān)操作
  • 注冊fb_info

    • register_framebuffer

三、編寫LCD驅(qū)動(dòng)框架

參考內(nèi)核代碼

drivers\video\fbdev\s3c2410fb.c

注:工作中LCD驅(qū)動(dòng)我們不用從頭寫,會(huì)改就行。

步驟如下:
1、分配fb_info
2、設(shè)置fb_info
要設(shè)置哪些內(nèi)容?根據(jù)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 設(shè)置fb_info *//* a. var : LCD分辨率、顏色格式 */myfb_info->var.xres = 1024;			//屏幕x像素點(diǎn)個(gè)數(shù)myfb_info->var.yres = 600;			//y像素點(diǎn)個(gè)數(shù)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個(gè)字節(jié)為顏色像素需要乘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://aloenet.com.cn/news/42122.html

相關(guān)文章:

  • 深圳專門做網(wǎng)站阿里云域名查詢和注冊
  • 簡易網(wǎng)站開發(fā)巨量引擎
  • 電子商務(wù)網(wǎng)站服務(wù)器上海網(wǎng)絡(luò)營銷公司
  • dw手機(jī)網(wǎng)站建設(shè)500個(gè)游戲推廣群
  • 班級網(wǎng)站素材下載百度推廣有哪些推廣方式
  • 大型網(wǎng)站制作梅州網(wǎng)絡(luò)推廣
  • 百度網(wǎng)站錄入網(wǎng)站整站優(yōu)化
  • 建行app官方下載搜索引擎優(yōu)化中的步驟包括
  • 淘寶優(yōu)惠券微網(wǎng)站開發(fā)手機(jī)版怎么用百度快照
  • wordpress固定鏈接是存在哪個(gè)表襄陽seo優(yōu)化排名
  • 如何查看一個(gè)網(wǎng)站是用什么程序做的南寧企業(yè)官網(wǎng)seo
  • 廣東網(wǎng)站建設(shè)公司報(bào)價(jià)表濟(jì)南做網(wǎng)站公司哪家好
  • 中企動(dòng)力合作網(wǎng)站銷售找客戶的方法
  • 凡科建站免費(fèi)版可以做什么2021熱門網(wǎng)絡(luò)營銷案例
  • 網(wǎng)站建設(shè)需要了解哪些方面seo上海培訓(xùn)
  • 校園云網(wǎng)站建設(shè)如何快速推廣網(wǎng)站
  • 遼寧建設(shè)廳規(guī)劃設(shè)計(jì)網(wǎng)站如何在百度做免費(fèi)推廣產(chǎn)品
  • 如何做旅游網(wǎng)站seo軟件定制
  • 西安網(wǎng)站建設(shè)制作價(jià)格百度客戶端登錄
  • 一個(gè)網(wǎng)站如何做推廣百度搜索風(fēng)云榜總榜
  • 男女做爰真人視頻免費(fèi)網(wǎng)站b2b網(wǎng)站有哪些平臺(tái)
  • 如何做淘寶客自己的網(wǎng)站營銷網(wǎng)站方案設(shè)計(jì)
  • 大連有幾家做網(wǎng)站的公司天津seo優(yōu)化排名
  • 企業(yè)公司網(wǎng)站 北京企業(yè)文化理念
  • 承德網(wǎng)站制作多少錢高質(zhì)量軟文
  • 做威客哪個(gè)網(wǎng)站好石家莊新聞
  • 網(wǎng)站開發(fā)涉及內(nèi)容做推廣的技巧
  • 做濾芯的網(wǎng)站seo軟件工具
  • 網(wǎng)站建設(shè)陜icp百度如何快速收錄網(wǎng)站
  • wordpress googleapisseo軟件