77 lines
1.4 KiB
C
77 lines
1.4 KiB
C
/*******************************************************************************
|
|
**
|
|
**文 件 名:WDog.h
|
|
**创建日期:2015.10.15
|
|
**文件说明:
|
|
**修改记录:
|
|
**版 本:V1.0
|
|
**备 注:
|
|
*******************************************************************************/
|
|
#ifndef _DRV_ADC_H_
|
|
#define _DRV_ADC_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "kit_macro.h"
|
|
|
|
typedef enum
|
|
{
|
|
kAdcDev_1,
|
|
kAdcDev_2,
|
|
kAdcDev_3,
|
|
kAdcDev_End,
|
|
}AdcDev;
|
|
|
|
typedef enum
|
|
{
|
|
kAdcChannel_0 = 0,
|
|
kAdcChannel_1,
|
|
kAdcChannel_2,
|
|
kAdcChannel_3,
|
|
kAdcChannel_4,
|
|
kAdcChannel_5,
|
|
kAdcChannel_6,
|
|
kAdcChannel_7,
|
|
kAdcChannel_8,
|
|
kAdcChannel_9,
|
|
kAdcChannel_10,
|
|
kAdcChannel_11,
|
|
kAdcChannel_12,
|
|
kAdcChannel_13,
|
|
kAdcChannel_14,
|
|
kAdcChannel_15,
|
|
kAdcChannel_16,
|
|
kAdcChannel_17,
|
|
kAdcChannel_End,
|
|
}AdcChannel;
|
|
|
|
typedef enum
|
|
{
|
|
kAdcSampleTime_3 = 0,
|
|
kAdcSampleTime_15,
|
|
kAdcSampleTime_28,
|
|
kAdcSampleTime_56,
|
|
kAdcSampleTime_84,
|
|
kAdcSampleTime_112,
|
|
kAdcSampleTime_144,
|
|
kAdcSampleTime_480,
|
|
kAdcSampleTime_End,
|
|
}AdcSampleTime;
|
|
|
|
typedef struct
|
|
{
|
|
AdcChannel channel;
|
|
AdcSampleTime cycle;
|
|
}AdcArray;
|
|
|
|
uint8_t drv_adc_init(AdcDev dev, const AdcArray *adc_arr, uint16_t len, uint16_t* dma_buf, uint8_t sample_cnt);
|
|
bool drv_adc_is_overflow(AdcDev dev);
|
|
uint16_t drv_adc_get_data(uint8_t idx);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|