Compass-memsic3280 debugging transcript

Source: Internet
Author: User

Steps:
(1) first, mem3280 is an I2C device, so the first step is to check the chip spec and determine its I2C address (0x30)
(2) After the address is determined, add I2C device information in the kernel/ARCH/ARM/mach-vc0882/board-vortex.c file:
1212 static struct i2c_board_info i2c_devs1 [] = {
1213 # ifdef config_sensor_ssz0304
1214 {i2c_board_info ("ssz0304-sensor", 0x55 ),},
1215 # endif
1216 # ifdef config_sensor_mmc3280
1217 {i2c_board_info ("mmc3280-sensor", 0x30 ),},
1218 # endif
..............................................................................
(3) The debug driver enables I2C communication, that is, data can be read. (See other I2C devices for the driver framework)
(4) After I2C is called, prepare to modify the Hal layer of Android. It is found that Hal processes sensors on the input device.
(5) change the driver to an input device (previously handled by a simple MISC device). You only need to refer to other input devices for this process.
(6) Now we have to deal with the Hal layer. We found that we didn't have to deal with the compass at all, and we had to add everything ourselves. This Hal is both awkward and complicated.
(7) There is no way to repeat all Hal's sensors processing functions and grasp the entire logic.
Note: Two test programs are used: hardware \ libhardware \ tests \ nusensors. cpp.
Frameworks \ base \ Services \ sensorservice \ tests \ sensorservicetest. cpp
An important debugging experience is to analyze functions and use loge printf to print debugging information. In addition, be careful and patient.

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.