ethan
2023-04-08 f5e277c240b9211a1f047b88788f34f3dd5a97c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "as5601.h"
#include "i2c.h"
#include "Hal_gpio.h"
#include "stm32l4xx_hal_i2c"
 
 
#define AS5601_ADDRESS  (0x6C) /**< in the as5601 datasheet the address (0x36) is expressed in 7 bit but needs to be left shifted by 1, giving 0x6C*/
 
#define ZMCO_ADDR       (0x00)
#define ZPOS_ADDR       (0x01)
#define CONF_ADDR       (0x07)
#define ABN_ADDR        (0x09)
#define PUSHTHR_ADDR    (0x0A)
#define RAWANGLE_ADDR   (0x0C)
#define ANGLE_ADDR      (0x0E)
#define STATUS_ADDR     (0x0B)
#define AGC_ADDR        (0x1A)
#define MAGNITUDE_ADDR  (0x1B)
#define BURN_CMD        (0xFF)
 
#define BURN_SETTING (0x40)
#define BURN_ANGLE (0x80)
 
extern uint16_t Hal_GetHallSensorRawValue(uint8_t channel);