#ifndef IMU_H_
#define IMU_H_
+#include <math.h>
+#include <stdint.h>
+
struct imu_info {
/* gyro */
double gx;
double yaw;
};
+/* angles in 1/100 degrees */
+struct imu_euler_int {
+ int16_t roll;
+ int16_t pitch;
+ int16_t yaw;
+};
+
/* initialize the IMU */
void imu_init(void);
* the timer callback. Does not lock irq, so it's up to the user to do that. */
void imu_get_info(struct imu_info *imu);
-/* return the latest position in a quaternion struct read in the timer
- * callback. Does not lock irq, so it's up to the user to do that. */
+/* return the latest position read in the timer callback in a quaternion
+ * struct. Does not lock irq, so it's up to the user to do that. */
void imu_get_pos_quat(struct quaternion *pos);
-/* return the latest position in an euler struct read in the timer
- * callback. Does not lock irq, so it's up to the user to do that. */
+/* return the latest position read in the timer callback in an euler
+ * struct. Does not lock irq, so it's up to the user to do that. */
void imu_get_pos_euler(struct euler *pos);
+/* return the latest position read in the timer callback in an imu_euler_int
+ * struct. Does not lock irq, so it's up to the user to do that. */
+void imu_get_pos_euler_int(struct imu_euler_int *pos);
+
#endif