Merge mculoop

This commit is contained in:
2022-09-06 08:39:50 +02:00
parent bfea87726c
commit f4b59acce0
10 changed files with 690 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright 2022 Oleg Borodin <borodin@unix7.org>
*/
#include <stdint.h>
typedef struct {
float ax;
float ay;
float az;
float gx;
float gy;
float gz;
} mpu_value_t;
typedef struct {
uint32_t bus;
uint8_t addr;
mpu_value_t err;
} mpu_t;
void mpu_setup(mpu_t* mpu, uint32_t i2c, uint8_t addr);
void mpu_calibrate(mpu_t* mpu, int count);
void mpu_read(mpu_t* mpu, mpu_value_t* val);