?? tadc.c.svn-base
字號:
/**
* This code and information is part of Trident DPTV API (TDAPI)
*
* Copyright (C) Trident Multimedia Technologies (Shanghai) Co., Ltd.
* 2001 All rights reserved.
*
* This file contains definitions and macros related to M16C/60 ADC.
*
* Revision:
* 06/3/2004 Created by Ivan.
*
*/
#include "tdefs.h"
#include "tio.h"
Byte tdGetADCValue(Byte ucChannel)
{
#if 0 // ADC is initialed outside, and ADC is always started.
//setting the ADCON1.
INTE0AD &=0x8F; // 10001111b
ADM0D1 = 0xC1; // 11000001b
ADMOD0 = 0x07; // 00000111b
while(tdTestSFRBitTrue(ADMOD0, _BIT7_));
#endif
switch(ucChannel)
{
case 0:
return tdReadSFR(ADREG04H);
case 1:
return tdReadSFR(ADREG15H);
case 2:
return tdReadSFR(ADREG26H);
case 3:
return tdReadSFR(ADREG37H);
}
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -