grove_compass
grove_compass.h@0:609518794a5d, 2015-06-09 (annotated)
- Committer:
- JackyZhangFromSeeed
- Date:
- Tue Jun 09 10:17:32 2015 +0000
- Revision:
- 0:609518794a5d
grove_compass
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JackyZhangFromSeeed | 0:609518794a5d | 1 | |
JackyZhangFromSeeed | 0:609518794a5d | 2 | |
JackyZhangFromSeeed | 0:609518794a5d | 3 | |
JackyZhangFromSeeed | 0:609518794a5d | 4 | #ifndef __GROVE_COMPASS_H__ |
JackyZhangFromSeeed | 0:609518794a5d | 5 | #define __GROVE_COMPASS_H__ |
JackyZhangFromSeeed | 0:609518794a5d | 6 | |
JackyZhangFromSeeed | 0:609518794a5d | 7 | #include "suli2.h" |
JackyZhangFromSeeed | 0:609518794a5d | 8 | |
JackyZhangFromSeeed | 0:609518794a5d | 9 | #define HMC5883L_ADDRESS (0x1E<<1) |
JackyZhangFromSeeed | 0:609518794a5d | 10 | |
JackyZhangFromSeeed | 0:609518794a5d | 11 | #define CONFIGURATION_REGISTERA 0x00 |
JackyZhangFromSeeed | 0:609518794a5d | 12 | #define CONFIGURATION_REGISTERB 0x01 |
JackyZhangFromSeeed | 0:609518794a5d | 13 | #define MODE_REGISTER 0x02 |
JackyZhangFromSeeed | 0:609518794a5d | 14 | #define DATA_REGISTER_BEGIN 0x03 |
JackyZhangFromSeeed | 0:609518794a5d | 15 | |
JackyZhangFromSeeed | 0:609518794a5d | 16 | #define MEASUREMENT_CONTINUOUS 0x00 |
JackyZhangFromSeeed | 0:609518794a5d | 17 | #define MEASUREMENT_SINGLE_SHOT 0x01 |
JackyZhangFromSeeed | 0:609518794a5d | 18 | #define MEASUREMENT_IDLE 0x03 |
JackyZhangFromSeeed | 0:609518794a5d | 19 | |
JackyZhangFromSeeed | 0:609518794a5d | 20 | #define PI ((float)3.1415926) |
JackyZhangFromSeeed | 0:609518794a5d | 21 | |
JackyZhangFromSeeed | 0:609518794a5d | 22 | void grove_compass_init(I2C_T *i2c, int pinsda, int pinscl); |
JackyZhangFromSeeed | 0:609518794a5d | 23 | bool grove_compass_write_setup(I2C_T *i2c); |
JackyZhangFromSeeed | 0:609518794a5d | 24 | bool grove_compass_getxyz_scaled(I2C_T *i2c, float *ax, float *ay, float *az); |
JackyZhangFromSeeed | 0:609518794a5d | 25 | bool grove_compass_getheading(I2C_T *i2c, float *heading); |
JackyZhangFromSeeed | 0:609518794a5d | 26 | |
JackyZhangFromSeeed | 0:609518794a5d | 27 | #endif |