Git Product home page Git Product logo

Comments (5)

KonstaT avatar KonstaT commented on July 19, 2024

You shouldn't need any sensor HAL modifications for this. If the sensor has an IIO kernel driver and type of the sensor is supported by the sensor HAL it should likely just work. You need to enable the kernel driver for your sensor hardware and add a device tree overlay to enable the driver/configure I2C. This only requires compiling the kernel & dtbs.

Probably can't explain it any better than I did here https://forums.raspberrypi.com/viewtopic.php?t=297349&start=125#p1927487 (read the rest of that page as well).

from android_kernel_brcm_rpi.

ilike28 avatar ilike28 commented on July 19, 2024

You shouldn't need any sensor HAL modifications for this. If the sensor has an IIO kernel driver and type of the sensor is supported by the sensor HAL it should likely just work. You need to enable the kernel driver for your sensor hardware and add a device tree overlay to enable the driver/configure I2C. This only requires compiling the kernel & dtbs.

Probably can't explain it any better than I did here https://forums.raspberrypi.com/viewtopic.php?t=297349&start=125#p1927487 (read the rest of that page as well).

The information you give is very precious!

Could you please tell me the following question~~??

Is this IIO HAL code written by you?? Or is it originally included in the Android source code??
If I want to write HAL code by myself, do you have any recommended reference materials?

For example
bmc150 is a 6-axis digital compass.
How does the compass API of the Android framework know which driver to connect to?

Thanks^_^

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

Is this IIO HAL code written by you?? Or is it originally included in the Android source code?? If I want to write HAL code by myself, do you have any recommended reference materials?

No, as you can see from the repository name, where it was forked from, and the copyright headers it was initially written by Intel. No, it is not part of Google's Android source code (AOSP) but Intel's fork to support Android on their platform (but AOSP has another IIO HAL from Intel https://android.googlesource.com/platform/hardware/intel/sensors/). One reference for IIO sensor HAL is of course the one I'm using (https://github.com/lineage-rpi/android_hardware_intel_sensors-iio) and I also have one forked from STMicro (https://github.com/lineage-rpi/android_hardware_st_sensors-iio). Android-x86 project has one additional IIO sensor HAL as well (http://git.osdn.net/view?p=android-x86/hardware-libsensors.git;a=summary).

For example bmc150 is a 6-axis digital compass. How does the compass API of the Android framework know which driver to connect to?

That's exactly what the sensor HAL is for. It sits between the kernel driver for the sensor hardware and the Android sensor framework (see https://source.android.com/devices/sensors/sensor-stack).

from android_kernel_brcm_rpi.

ilike28 avatar ilike28 commented on July 19, 2024

Is this IIO HAL code written by you?? Or is it originally included in the Android source code?? If I want to write HAL code by myself, do you have any recommended reference materials?

No, as you can see from the repository name, where it was forked from, and the copyright headers it was initially written by Intel. No, it is not part of Google's Android source code (AOSP) but Intel's fork to support Android on their platform (but AOSP has another IIO HAL from Intel https://android.googlesource.com/platform/hardware/intel/sensors/). One reference for IIO sensor HAL is of course the one I'm using (https://github.com/lineage-rpi/android_hardware_intel_sensors-iio) and I also have one forked from STMicro (https://github.com/lineage-rpi/android_hardware_st_sensors-iio). Android-x86 project has one additional IIO sensor HAL as well (http://git.osdn.net/view?p=android-x86/hardware-libsensors.git;a=summary).

For example bmc150 is a 6-axis digital compass. How does the compass API of the Android framework know which driver to connect to?

That's exactly what the sensor HAL is for. It sits between the kernel driver for the sensor hardware and the Android sensor framework (see https://source.android.com/devices/sensors/sensor-stack).

The Following web page in "android_hardware_intel_sensors-iio" is not found.
Do you know where can find reference materials on these two web pages?

https://source.android.com/devices/sensors/hal-interface.html
[basic tour of the Android sensors HAL interface]

http://source.android.com/devices/halref/sensors_8h_source.html
[Android sensor details]

In addition, in addition to HAL and DTBO config these two blocks need to be set
Do init.rc and ueventd.rc usually need to be modified?

Thanks ^_^

from android_kernel_brcm_rpi.

KonstaT avatar KonstaT commented on July 19, 2024

Do you know where can find reference materials on these two web pages?

Android documentation should have the information that is still relevant today (current Android versions).

In addition, in addition to HAL and DTBO config these two blocks need to be set Do init.rc and ueventd.rc usually need to be modified?

Usually yes, depends on the sensor HAL. All the necessary file permissions for the IIO sensor HAL I'm using are already there on my builds so if you're adding a sensor no modification should be necessary.

from android_kernel_brcm_rpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.