whycyhl
2022-05-05 94861120b14313f81fc666e612c48c9e8a81f1e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/************************** Copyright (c) **********************************
**                 FUZHOU FUGUANG ELECTRONICS Co.,LTD.
**                        ¸£Öݸ£¹âµç×ÓÓÐÏÞ¹«Ë¾
**                       http://www.fuguang.com
**
**-------------- File Info -------------------------------------------------
** File name:            M64ADC_Driver.h
** Last modified Date:  2008-11-16
** Last Version:        1.0
** Descriptions:        M64ADC Drivers lib
**
**--------------------------------------------------------------------------
** Created by:            mxpopstar
** Created date:        2008-11-16
** Version:                1.0
** Descriptions:        The original version
**
**--------------------------------------------------------------------------
** Modified by:            mxpopstar
** Modified date:        2008-11-20
** Version:
** Descriptions:        M64ADC Drivers lib
**
***************************************************************************/
//
#ifndef M64ADC_Dri_H
#define M64ADC_Dri_H
 
#define     ADCCH         0
#define     ADCDH         1
#define     ADCXA         2
#define     ADCIA         3
#define     ADCTEMP     4
#define        POWER_CK    5
#define        TEMPH_CK    7
 
#define     ACPOWER_CK_ENABLE    0
#define     ACPOWER_CK_DISABLE    1
 
#define     ACPOWER_OFF   (!(PINF & (1<<POWER_CK)))
#define     TmpeTooHigh   (!(PINF & (1<<TEMPH_CK))) 
 
/*
typedef struct adj
{
    unsigned char onlinevol;
    unsigned char innersumvol;
    unsigned char dischargecurrent;
    unsigned char chargecurrent;
    unsigned char externalcurrent;    
}ValueAdj;
*/ 
//
 
#include <avr/io.h>
#include <util/delay.h>
#include "Define.h"
 
void InitIO_M64ADC(void);
void Config_M64ADC(void);
void Restart_ADC_System(void);
unsigned int GetADCAdjustValue(const unsigned char index, const unsigned char readEEp);
void SetADCAdjustValue(const unsigned char index, const unsigned int value, const unsigned char writeEEp);
unsigned int Get_ADC_Value(const unsigned char channel, const unsigned int parm1, const unsigned int parm2);
void GetVolCurrent(volatile FBO_Data *idcedata);
unsigned int GetInnerSumVol(void);
unsigned int GetOnlineVol(void);
unsigned int GetDisChargeI(void);
unsigned int GetChargeI(void);
unsigned int GetExternalI(void);
void SetSumSubCurrent(const unsigned int value);
void DSPTemperature(const unsigned int x, const unsigned int y, const unsigned char color);
unsigned char Get_ACPOWER_State(void);
void Set_ACPOWER_Work(const unsigned char state);
void Check_ACPOWER_State(void);
void CheckTempHighAlert(void);
void ResetTempHighAlert(void);
void SetSumVolParam(const unsigned char param);
unsigned int GetADCSumVolValue(void);
 
#endif
//