?? filter.c
字號:
//---------------------------------------------------------------------------
// Terawins Inc. Company Confidential Strictly Private
//
// $Archive: Filter.c $
// $Revision: 1.01 $
// $Author: JoannW $
// $Date: 2002/06/27 $
//
// --------------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// --------------------------------------------------------------------------
// Copyright 2002 (c) Terawins Inc.
// --------------------------------------------------------------------------
#include <reg51.h>
#include "common.h"
#include "Struct.h"
#include "TW10xReg.h"
#include "Filter.h"
#include "TwoWire.h"
#if (defined T100A)|(defined T101)
#include ".\source\T100\FiltDatT100A.c"
#endif
#ifdef T101A
#include ".\source\T100\FiltDatT101A.c"
#endif
#if (defined T102)|(defined T106)|(defined T112)|(defined T116)|(defined T118)
#include ".\source\T100\FiltDatT102.c"
#endif
void LoadFilter(uCHAR cFilterID)
{
uCHAR i;
uCHAR c;
uCHAR code *p=ScaleCoefData[cFilterID];
// turn off 2-wire bus address auto increase
//I2CWriteByte(TW101,TW_INTERFACE,I2CReadByte(TW101,TW_INTERFACE)&~AUTO_INC );
//I2CWriteByte(TW101,SCALING_CTRL,0x01); //Reset write pointer to 0x00
#ifdef T100
I2CWriteByte(TW101,SCALING_CTRL,0x81|DCLKI_IS_FASTER);
#else
I2CWriteByte(TW101,SCALING_CTRL,0x81); //or 00 not sure
#endif
for(i=0; i<SCALECOEFSIZE; i++)
{
c=*p++;
I2CWriteByte(TW101,COEF_DATA_PORT,c);
}
// turn on 2-wire bus address auto increase
I2CWriteByte(TW101,TW_INTERFACE,I2CReadByte(TW101,TW_INTERFACE)|AUTO_INC);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -