filter.c
来自「台湾宏芯针对几乎市面所有模拟TFT屏驱动芯片T100-T101-T103-T11」· C语言 代码 · 共 60 行
C
60 行
//---------------------------------------------------------------------------
// 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)
#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 + =
减小字号Ctrl + -
显示快捷键?