85 lines
1.8 KiB
C
85 lines
1.8 KiB
C
![]() |
#ifndef __AD7606_H__
|
||
|
#define __AD7606_H__
|
||
|
|
||
|
#include "./SYSTEM/sys/sys.h"
|
||
|
#include "./SYSTEM/fsmc/fsmc.h"
|
||
|
#include "./SYSTEM/tim1/tim1_PWM.h"
|
||
|
#include "./SYSTEM/usart/usart.h"
|
||
|
#include "usbd_cdc_if.h"
|
||
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include "./BSP/AD7606/ControlCommandReceive.h"
|
||
|
|
||
|
|
||
|
#define BUSY1_Pin GPIO_PIN_4
|
||
|
#define BUSY1_GPIO_Port GPIOB
|
||
|
|
||
|
#define BUSY2_Pin GPIO_PIN_2
|
||
|
#define BUSY2_GPIO_Port GPIOF
|
||
|
|
||
|
#define FRSTDATA2_Pin GPIO_PIN_8
|
||
|
#define FRSTDATA2_GPIO_Port GPIOG
|
||
|
|
||
|
#define FRSTDATA1_Pin GPIO_PIN_8
|
||
|
#define FRSTDATA1_GPIO_Port GPIOC
|
||
|
|
||
|
#define CONVEST_Pin GPIO_PIN_1
|
||
|
#define CONVEST_GPIO_Port GPIOA
|
||
|
|
||
|
#define RESET_Pin GPIO_PIN_11
|
||
|
#define RESET_GPIO_Port GPIOG
|
||
|
|
||
|
#define RANGE1_Pin GPIO_PIN_14
|
||
|
#define RANGE1_GPIO_Port GPIOG
|
||
|
|
||
|
#define RANGE2_Pin GPIO_PIN_13
|
||
|
#define RANGE2_GPIO_Port GPIOG
|
||
|
|
||
|
|
||
|
#define BYTE_SEL_Pin GPIO_PIN_8
|
||
|
#define BYTE_SEL_GPIO_Port GPIOB
|
||
|
|
||
|
#define OS2_Pin GPIO_PIN_5
|
||
|
#define OS2_GPIO_Port GPIOG
|
||
|
|
||
|
#define OS1_Pin GPIO_PIN_6
|
||
|
#define OS1_GPIO_Port GPIOG
|
||
|
|
||
|
#define OS0_Pin GPIO_PIN_7
|
||
|
#define OS0_GPIO_Port GPIOG
|
||
|
|
||
|
#define STBY1_Pin GPIO_PIN_3
|
||
|
#define STBY1_GPIO_Port GPIOB
|
||
|
|
||
|
#define STBY2_Pin GPIO_PIN_15
|
||
|
#define STBY2_GPIO_Port GPIOG
|
||
|
|
||
|
#define Rev_Pin GPIO_PIN_9 //转速引脚
|
||
|
#define Rev_GPIO_Port GPIOF
|
||
|
|
||
|
/* AD数据采集缓冲区 FIFO */
|
||
|
#define ADC_FIFO_SIZE (8*1024) /* 总体样本数 */
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
int16_t sNowAdc[12]; /* 当前ADC值, 有符号数 */
|
||
|
}AD7606_VAR_T;
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
/* FIFO 结构 */
|
||
|
uint16_t usRead; /* 读指针 */
|
||
|
uint16_t usWrite; /* 写指针 */
|
||
|
|
||
|
uint16_t usCount; /* 新数据个数 */
|
||
|
uint8_t ucFull; /* FIFO满标志 */
|
||
|
|
||
|
int8_t sBuf[ADC_FIFO_SIZE];
|
||
|
}AD7606_FIFO_T;
|
||
|
|
||
|
void AD7606_Init();
|
||
|
void AD7606_StartRecord(void);
|
||
|
void AD7606_StopRecord(void);
|
||
|
void AD7606_ISR(void);
|
||
|
#endif
|