Learning Vedon Video Experience (iii)

Source: Internet
Author: User

Learning Vedon Video Experience (iii)

I²c The bus is widely used in a variety of sensors, only through the SDA,SCL line to achieve the communication between the host and the device. The Linux system has a large drive of i²c. The Linux system can be used in two ways to achieve the I²C device driver, we can not only use the I²C device as a normal character device to operate, but also can take advantage of the core of the large and complex framework. If the programmer as a normal character device, as long as the pin analog timing or the implementation of the I²C controller does not use the kernel framework, so that programmers do not need to study the I²C device to drive a huge framework, but, so write out of the driver is similar to the single-chip microcomputer, transplant performance is poor, the advantages are relatively straightforward. If you adopt a kernel-driven framework, the larger system requires a programmer to understand the I²c driver framework. This design uses the Linux kernel i²c driver framework.

650) this.width=650; "Width=" 553 "height=" 411 "src=" http://set1.mail.qq.com/cgi-bin/viewfile?f= 66a91c2d59b9219710e547f38e426ebfd38a0c8fc2627b6f45b03ecc94add0144e839cf8040f6896da361e13e40d2c5b2547d636eccfc8dd11ada1620 b59e2c1026d7cdd2651d323287f5ea9f77a7153bd9d1c41c4d5846fbb91403a33b66b67&mailid=zc3607-ohqs8wats~ 6lbh9kialjf55&sid=ga_ggxigwj3rfw5b&net=1351846154 "style=" border:none;vertical-align:middle; "alt=" viewfile?f=66a91c2d59b9219710e547f38e426 "/>                                                                    

Figure 2.12 I²c driver Framework

i2c I2C-DEV.C i2c-dev.c Universal interface, Only one adapter type I2c_adapter is created, only one master device number is registered, and no device file is created, but the IOCTL function sends the address from the device, sends the data through the Universal interface call core interface, and then creates the temporary virtual device file, so to speak, If you are walking a generic component, just build an adaptation type. If you go to a particular type of component such as ov9650 and gt811 capacitive touch screen, created i2c_client, create device files. As shown in 2.12.

I²c The drive group is divided into three layers and four files. Device Drive Layer(ov9650.c), Core layer (i2c-core.c), bus driver layer (i2c-s3c2410.c ), resource layer (same level with bus driver layer) dev-i2c0.c .

1.I2C Device driver Layer

I²c device driver layer, in fact, equivalent to the platform device mechanism of the driving layer, build i2c_driver, register I2c_driver, implement probe function and operation method, in the probe function: Get i2c_cilent, register the main device number, create the device file, Register the action method.

2.I2C Core layer: A function interface implementation is provided in the core layer, and then the Send receive function is encapsulated.

3.I2C Bus driver Layer

As a result of platform device driving mechanism, this layer acquires platform resources, realizes the probe function: Get the resource, the initial HA hardware, enable clock, register interrupt and so on, then constructs the I2c_adapter, registers the adaptation to the I²c bus. Finally scanned the board-level information chain list, by name, if the match succeeds, create the device file. In addition, this layer implements the method of sending and reading data.

4.I2C Resource layer: Wrap the base address and size, i²c interrupt number.

5.I2C board-level resources

I²c board level resources This implementation greatly facilitates the I²C drive migration, and all Samsung's core registry platform data is in SMKDV210.C. Set the I²C board level information (slave address and name) in a large array of platform devices, and finally register in the Smdkv210_machine_init () function in the board-level information chain list.

2.1.4GT811(touch screen) driver

   gt811

650) this.width=650; "width=" 413 "height=" 439 "src=" http://set1.mail.qq.com/cgi-bin/viewfile?f= 66a91c2d59b9219710e547f38e426ebfd38a0c8fc2627b6f45b03ecc94add0144e839cf8040f6896da361e13e40d2c5b2547d636eccfc8dd7bfd15cb8 bdb20635b4115c007cb28623ca3f2b9cb8199fd07764bcb9a7e4bce089627e5e92b59cd&mailid=zc3607-ohqs8wats~ 6lbh9kialjf55&sid=ga_ggxigwj3rfw5b&net=1351846154 "style=" border:none;vertical-align:middle; "alt=" viewfile?f=66a91c2d59b9219710e547f38e426 "/>

Figure 2.13 GT811 Drive Architecture


Learning Vedon Video Experience (iii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.