📄 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;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -