This commit is contained in:
2024-09-26 22:32:20 +08:00
commit 097089ef4e
323 changed files with 135661 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
/*
* Ang_AS5600DO.h
*
* Created on: Jun 22, 2020
* Author: matth
*/
#ifndef MATT_ANGLE_AS5600_H_
#define MATT_ANGLE_AS5600_H_
#include "I2CDevice.h"
#include <FreeRTOS.h>
#ifndef HAL_ANG_AS5600_I2C_ADDR
#define HAL_ANG_AS5600_I2C_ADDR 0x36
#endif
#ifndef HAL_ANG_AS5200T_I2C_ADDR
#define HAL_ANG_AS5200T_I2C_ADDR 0x40
#endif
#ifndef HAL_ANG_AS5200B_I2C_ADDR
#define HAL_ANG_AS5200B_I2C_ADDR 0x40
#endif
#define AS5600_ZMCO (0x00)
#define AS5600_ZPOS_H (0x01)
#define AS5600_ZPOS_L (0x02)
#define AS5600_MPOS_H (0x03)
#define AS5600_MPOS_L (0x04)
#define AS5600_MANG_H (0x05)
#define AS5600_MANG_L (0x06)
#define AS5600_CONF_H (0x07)
#define AS5600_CONF_L (0x08)
#define AS5600_RAW_ANGLE_H (0x0C)
#define AS5600_RAW_ANGLE_L (0x0D)
#define AS5600_ANGLE_H (0x0E)
#define AS5600_ANGLE_L (0x0F)
#define AS5600_STATUS (0x0B)
#define AS5600_AGC (0x1A)
#define AS5600_MAGNITUDE_H (0x1B)
#define AS5600_MAGNITUDE_L (0x1C)
#define AS5600_BURN (0xFF)
typedef struct Ang_AS5600{
const char *name;
I2C_DEV_t *_dev;
float angle;
uint8_t status;
} Ang_AS5600_t;
bool Ang_AS5600_init(Ang_AS5600_t *ang, const char *name, I2C_DEV_t *dev);
bool Ang_AS5600_update(Ang_AS5600_t *ang);
#endif /* MATT_ANGLE_AS5600_H_ */