stm32-moto/Core/Inc/icm20948.h

24 lines
689 B
C

#ifndef ICM20948_H
#define ICM20948_H
#include "stm32l4xx_hal.h"
// Adresse I2C par défaut (SA0=1)
#define ICM20948_I2C_ADDR (0x69 << 1)
// ----- Fonctions de configuration -----
void icm20948_init(void);
void icm20948_mag_init(void);
// ----- Fonctions de lecture -----
void icm20948_read_accel(float *ax, float *ay, float *az);
void icm20948_read_gyro(float *gx, float *gy, float *gz);
void icm20948_read_mag(float *mx, float *my, float *mz);
// ----- Fonctions internes (optionnelles, si besoin hors module) -----
void icm20948_select_bank(uint8_t bank);
uint8_t icm20948_read_register(uint8_t reg);
void icm20948_write_register(uint8_t reg, uint8_t val);
#endif // ICM20948_H