This commit is contained in:
2024-09-26 22:32:20 +08:00
commit 097089ef4e
323 changed files with 135661 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#ifndef __MAG_HMC5883L__H__
#define __MAG_HMC5883L__H__
#include "I2CDevice.h"
#include "GPIO_EXTI.h"
// Registers
#ifndef HAL_MAG_HMC5883_I2C_ADDR
#define HAL_MAG_HMC5883_I2C_ADDR 0x1E
#endif
typedef struct Mag_HMC5883{
const char *name;
I2C_DEV_t *_dev;
int16_t magnet_xyz[3];
GPIO_EXIT_t *exti;
int cnt;
int last_cnt;
int pps;
} Mag_HMC5883_t;
extern int Mag_HMC5883_init(Mag_HMC5883_t *mag, const char *name, I2C_DEV_t *dev, GPIO_EXIT_t *exti);
extern bool Mag_HMC5883_update(Mag_HMC5883_t *mag);
extern void Mag_HMC5883_stats(Mag_HMC5883_t *mag);
#endif