This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
CMS3in1/2.Blade/1.Software/STM32/Drivers/BSP/AD7606/AD7606.h

68 lines
1.5 KiB
C
Raw Permalink Normal View History

#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 "./SYSTEM/delay/delay.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 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 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
/* AD数据采集缓冲区 FIFO */
#define ADC_FIFO_SIZE (8*1024) /* 总体样本数 */
typedef struct
{
int16_t sNowAdc[8]; /* 当前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