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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/************************** Copyright (c) **********************************
**                 FUZHOU FUGUANG ELECTRONICS Co.,LTD.
**                        ¸£Öݸ£¹âµç×ÓÓÐÏÞ¹«Ë¾
**                       http://www.fuguang.com
**
**-------------- File Info -------------------------------------------------
** File name:            WorkingPage.h
** Last modified Date:  2008-11-16
** Last Version:        1.0
** Descriptions:        Discharge test control functions
**
**--------------------------------------------------------------------------
** 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:        Discharge test control functions
**
***************************************************************************/
//
 
#ifndef WorkingPage_H
#define WorkingPage_H
 
//----------- ·Åµç״̬ ------------
#define WPMANUALPSTOP     0
#define WPTIMESTOP         1
#define WPCAPSTOP         2
#define WPMVLLSTOP         3
#define WPSVLLSTOP         4
#define WPPOWERBREAKSTOP 5
#define WPFLASHUPSTOP     6
#define WPTEMPHIGHSTOP   7 
#define WPDISCHARGING    8
#define WPMANUALPAUSE     9
#define WPAUTOPAUSE         10
 
#define DischargeControlInit  (0xFFFF&(~WIND))
 
#define PWMValueMax    343
#define PWMValueMin    10
 
#define PageMode_Set   0
#define PageMode_View  1
 
//-------- ±¾»ú·Åµç¿ØÖÆ ---------
#define DRY7    (1<<1)
#define DRY6    (1<<2)
#define DRY5    (1<<3)
//-------- ²¢»ú¿ØÖÆ -------------
#define DRY4    (1<<4)
#define DRY3    (1<<5)
#define DRY2    (1<<6)
#define CDRY2   (1<<5)
#define CDRY1   (1<<6)
#define DRY1    (1<<7)
 
 
//---------²âÊÔģʽ£ºÔ¤·Å¹¦ÂÊÓëÔ¤·ÅµçÁ÷----------
#define Static_Curr            0
#define Static_Power          1
#define Static_Res          2
 
 
//-------- ±¾»ú·Åµç¿ØÖÆ ---------
#define DRY7            (1<<1)
#define DRY6            (1<<2)
#define DRY5            (1<<3)
#define DRY4            (1<<4)
//-------- ³äµç°åMOS¹Ü ----------
#define DRY3            (1<<5)
#define DRY2            (1<<6)
#define CDRY2           (1<<5)
#define CDRY1           (1<<6)
//-------- ±¸Óà-----------------
#define DRY1            (1<<7)
//-------------------------------
#define    VDRY1            (1<<7)
#define VDRY2            (1<<6)
#define VDRY3            (1<<5)
//-------------------------------
#define WIND            (1<<8)       //¿ØÖÆ·çÉȵļ̵çÆ÷
#define LargeCharge     (1<<9)      //µÈµçλ³äµç¿ØÖÆ
#define PowerSwitch        (1<<10)        //¶Ï·Æ÷ÍÑ¿ÛÆ÷½âËø
#define ParallelCtrl    (1<<11)        //²¢»ú¿ØÖÆ
#define SmallCharge        (1<<12)      //ÏÞÁ÷³äµç°å¼ÌµçÆ÷¿ØÖÆ   
#define CtrlPowerAll    (1<<13)      //·Åµçͨ·¿ØÖÆ
 
 
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include "Define.h"
 
void StartTestingFrom(unsigned char workstate);
void ResumeTestingFrom(unsigned char workstate);
void SuspendTesting(const unsigned char pausetype);
void StopTesting(const unsigned char stoptype);
void InitDisChargePower(void);        //·Åµç³õʼ»¯
void CloseDisChargePower(const unsigned char workstate);
void OpenDisChargePower(const unsigned char workstate);
void SetPowerSwitchEnabled(void);        //ÍÑ¿ÛÆ÷½âËø
void SetPowerSwitchDisabled(void);
void CheckIfStop(const volatile FBO_Data *fbodata, const volatile unsigned int *parm);
unsigned char StartErrorCheck(void);
unsigned char GetTestingParmIndex(void);
unsigned char InitTestingParm(void);
unsigned char GetChargeWaitCountDown(void);
void TestingTimeUp(void);
unsigned int GetDischargePowerState(void);
void SetDischargePowerState(unsigned int setdata);
void UpdateValue(void);
unsigned char GetWPStateIndex(void);
void UpdateWPStateText(unsigned char stateindex);
void SetAndUpdateParm(unsigned int *parm, unsigned char index, unsigned char setdirection);
void DSPTestingParmItem(unsigned char index, unsigned char Bcolor, unsigned char Fcolor);
void UpdateTestingParm(const unsigned int *Parm);
unsigned char DSPWorkingPage(void);
void DSPWorkingPageText(void);
void GetWorkingPageButtonDown(void);
void DrawControlButton(const unsigned char sysstate);
void DrawPresetButton(const unsigned char sysstate);
unsigned int GetFDCurrent(unsigned int stdcap, unsigned char hourrate);
unsigned char GetHourRate(unsigned int stdah, unsigned int current);
void ControlCurrent(unsigned int current, unsigned int settedcurrent);
void ControlCurrentToPower(const unsigned int settedpower);
void CloseSelfRelay(void);
unsigned char WPGetVolRange(void);
void ClearDischargePowerState(unsigned int cleardata);
#endif
//