29 lines
584 B
C
29 lines
584 B
C
#ifndef ADS8321_H
|
|
#define ADS8321_H
|
|
|
|
#include "main.h"
|
|
|
|
#define ADC_CHANNEL_NUM 2
|
|
#define ADC_QUEUE_LEN 6000
|
|
#define PACKET_DATA_UNIT_NUM 6000
|
|
|
|
#pragma pack(1)
|
|
typedef struct __adcDataUnitDef {
|
|
uint16_t aulData[ADC_CHANNEL_NUM];
|
|
} adcDataUnitDef;
|
|
|
|
typedef struct __adcDataQueueDef {
|
|
uint32_t ulReadPos;
|
|
uint32_t ulWritePos;
|
|
adcDataUnitDef atQueue[ADC_QUEUE_LEN];
|
|
} adcDataQueueDef;
|
|
#pragma pack()
|
|
|
|
extern volatile adcDataQueueDef gtAdcDataQueue;
|
|
|
|
uint16_t adcDataQueueLen(void);
|
|
void adcSampleStart(void);
|
|
void adcSampleStop(void);
|
|
|
|
#endif // ADS8321_H
|