I2C driver for HMC5583L digital compass sensor

Dependents:   m3Dpi

Committer:
sillevl
Date:
Thu Dec 03 07:52:58 2015 +0000
Revision:
0:91f08ac76444
Child:
1:097089f0feb1
initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 0:91f08ac76444 1
sillevl 0:91f08ac76444 2 #pragma once
sillevl 0:91f08ac76444 3
sillevl 0:91f08ac76444 4 #include "mbed.h"
sillevl 0:91f08ac76444 5
sillevl 0:91f08ac76444 6 struct coord{
sillevl 0:91f08ac76444 7 int x;
sillevl 0:91f08ac76444 8 int y;
sillevl 0:91f08ac76444 9 int z;
sillevl 0:91f08ac76444 10 };
sillevl 0:91f08ac76444 11
sillevl 0:91f08ac76444 12 class HMC5583L{
sillevl 0:91f08ac76444 13 public:
sillevl 0:91f08ac76444 14 HMC5583L(PinName sda, PinName scl, int address);
sillevl 0:91f08ac76444 15
sillevl 0:91f08ac76444 16 coord getCompass();
sillevl 0:91f08ac76444 17
sillevl 0:91f08ac76444 18 protected:
sillevl 0:91f08ac76444 19 int address;
sillevl 0:91f08ac76444 20 I2C i2c;
sillevl 0:91f08ac76444 21
sillevl 0:91f08ac76444 22 protected:
sillevl 0:91f08ac76444 23 int regToInt(char msb, char lsb);
sillevl 0:91f08ac76444 24
sillevl 0:91f08ac76444 25 };