初始提交
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#ifndef DDC112_H
|
||||
#define DDC112_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
typedef enum {
|
||||
DDC_RANG_EXTERN = 0,
|
||||
DDC_RANG_12_5_PF,
|
||||
DDC_RANG_25_0_PF,
|
||||
DDC_RANG_37_5_PF,
|
||||
DDC_RANG_50_0_PF,
|
||||
DDC_RANG_62_5_PF,
|
||||
DDC_RANG_75_0_PF,
|
||||
DDC_RANG_87_5_PF,
|
||||
DDC_RANG_MAX,
|
||||
} DDC_RANG_DEF;
|
||||
|
||||
#define ADC_CHANNEL_NUM 2
|
||||
#define ADC_QUEUE_LEN 16250
|
||||
#define PACKET_DATA_UNIT_NUM 16000
|
||||
|
||||
#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()
|
||||
|
||||
|
||||
int ddc112Start(uint16_t delay, uint32_t ulDuration);
|
||||
int ddc112Stop(void);
|
||||
|
||||
void ddc112SetTestMode(uint8_t ucMode);
|
||||
|
||||
void ddc112Init(void);
|
||||
void ddc112SetRange(DDC_RANG_DEF eRange);
|
||||
|
||||
extern void DDC112_IRQHandler(void);
|
||||
/**
|
||||
* @brief ddc112ValueToCurrent
|
||||
* @param ulValue
|
||||
* @return 电流,单位uA
|
||||
*/
|
||||
float ddc112ValueToCurrent(uint32_t ulValue);
|
||||
|
||||
void ddc112UpdateParam(void);
|
||||
|
||||
#endif // DDC112_H
|
||||
Reference in New Issue
Block a user