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