This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Driver code for hmc5883l

Other Parts Discussed in Thread: 4460, 4430

Hi all,

Can anyone provide me C driver code for hmc5883l  3 axis compass for my custom omap 4460 platform (Android ICs)

Thanks

Abhijit

  • Abhijit,

    Included with the TI OMAP4460 ICS releases are compass drivers for only AK8975 and HMC5843 (/kernel/android-3.0/drivers/staging/iio/magnetometer).  You will need to adapt one of these drivers to meet your needs or check with the vendor of your compass if there is already a driver available.

    Regards,
    Gina 

  • Hi Gina,

    ICS release has two drivers one is kernel/android-3.0/drivers/staging/iio/magnetometer and the other one is kernel/android-3.0/drivers/input/misc/hmc5843.c.

    Can you tell me which one to use.

    Thanks

    Abhijit

  • Abhijit,

    It looks like the driver currently used for Blaze and Blaze Tablet is in kernel/android-3.0/drivers/input/misc/hmc5843.c.  In /drivers/input/misc/Makefile:

    obj-$(CONFIG_INPUT_HMC5843) += hmc5843.o

    Compared to /drivers/staging/iio/magnetometer/Makefile:

    obj-$(CONFIG_SENSORS_HMC5843) += hmc5843.o

    In /arch/arm/mach-omap2/Kconfig:

    config MACH_OMAP_4430SDP

    bool "OMAP 4430 SDP board"
    default y
    depends on ARCH_OMAP4
    select LEDS_OMAP4430_SDP_DISPLAY
    select LEDS_OMAP4430_SDP_KEYPAD
    select SENSORS_LM75
    select INPUT_BH1780
    select INPUT_BMP085
    select INPUT_HMC5843

    ....

    You will want to check if this is the same in the setup you are using.

    Regards,
    Gina 

  • Abhijit,

    Please see post http://e2e.ti.com/support/omap/f/849/t/212814.aspx for some information about a driver for HMC5883.

    Regards,
    Gina