32 lines
733 B
C
32 lines
733 B
C
#ifndef _READ_SPI_H_
|
|
#define _READ_SPI_H_
|
|
|
|
#include "spi.h"
|
|
#include "gpio.h"
|
|
#include "struct_typedef.h"
|
|
// AS5047p ??
|
|
#define NOP 0x0000
|
|
#define ERRFL 0x0001
|
|
#define PROG 0x0003
|
|
#define DIAAGC 0x3FFC
|
|
#define MAG 0x3FFD
|
|
#define ANGLEUNC 0x3FFE
|
|
#define ANGLECOM 0x3FFF
|
|
|
|
#define ZPOSM 0x0016
|
|
#define ZPOSL 0x0017
|
|
#define SETTINGS1 0x0018
|
|
#define SETTINGS2 0x0019
|
|
|
|
#define AS5407P_CS_H() \
|
|
HAL_GPIO_WritePin(SPI_CS_GPIO_Port, SPI_CS_Pin, GPIO_PIN_SET)
|
|
#define AS5407P_CS_L() \
|
|
HAL_GPIO_WritePin(SPI_CS_GPIO_Port, SPI_CS_Pin, GPIO_PIN_RESET)
|
|
|
|
uint16_t Parity_bit_Calculate(uint16_t data_2_cal);
|
|
uint16_t SPI_ReadWrite_OneByte(uint16_t _txdata);
|
|
uint16_t AS5047_read(uint16_t add);
|
|
void Update_MultiTurn_Angle(void);
|
|
|
|
#endif
|