/************************** 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
|
//
|