資源簡介
系統配置
AD轉換驅動
IIC驅動
SPI驅動
UART驅動
TIMER驅動
等

代碼片段和文件信息
/************************************************************************************
*??Copyright?(c)?2006-2007?C8051F網絡
*????????????All?rights?reserved.
*
*?Http:???www.c8051f.com
*?Email:??mite@vip.qq.com
*
*?File?name:?adc.c
*?Project??:?C8051F340DK
*?Processor:?C8051F340
*?Compiler?:?Keil?C51?Compiler
*?
*?Author?:?embedARM
*?Version:?1.00
*?Date???:?2009.4.1
*?Email??:?embedARM@126.com
*?Modification:?none
*
*?Description:?本文件ADC硬件驅動程序文件;
*
*?Others:?none;
*
*?Function?List:
* 1.?void?ADC_Init(void)
*???2.?void?ADC_Enable(void)
* 3.?void?ADC_Disable(void)
* 4.?void?ADC_Read(int?*p)
*
*?History:
*???1.?Author:???????李林利??
* ???Version:? ?0.9
* ???Date:?????????2009.1.1
*??????Modification:?none
*
*************************************************************************************/
/************************************************************************************/
//?引用外部頭文件
/************************************************************************************/
#include?“..\config\c8051f340.h“
#include?“..\config\const.h“
#include?“delay.h“
/************************************************************************************/
//?常量及全局變量定義
/************************************************************************************/
#define?AIN1?0x04
#define?AIN2?0x05
#define?TEMP?0x1E
#define?ADC_CLK?1600000
#define?T_US?20
extern?unsigned?long?code?sysclk;
/*************************************************************************************/
//
//? ADC硬件驅動程序函數定義
//
/*************************************************************************************/
/***********************************************************************************
*?Function:?ADC_Init;
*
*?Description:?ADC初始化函數;
*??????????????
*?Input:??none;
*
*?Output:?none;
*
*?Return:?none;
*
*?Note:???none;
************************************************************************************/
void?ADC_Init?(void)
{
REF0CN?=?0x07;//使用ref電壓基準
AMX0P?=?0x0f;//選擇AIN?--?P1.7
AMX0N?=?0x1f;//選擇GND
ADC0CF=(sysclk/ADC_CLK)<<3;//ADC轉換時鐘
ADC0CN?=?0x00;?
}
/***********************************************************************************
*?Function:?ADC_Enable;
*
*?Description:?ADC使能函數?ADC開始工作;
*??????????????
*?Input:??none;
*
*?Output:?none;
*
*?Return:?none;
*
*?Note:???none;
************************************************************************************/
void?ADC_Enable(void)
{
AD0EN?=?1;
}
/***********************************************************************************
*?Function:?ADC_Disable;
*
*?Description:?ADC關閉函數?ADC停止工作;
*??????????????
*?Input:??none;
*
*?Output:?none;
*
*?Return:?none;
*
*?Note:???none;
************************************************************************************/
void?ADC_Disable(void)
{
AD0EN?=?0;
}
/***********************************************************************************
*?Function:?ADC_Read;
*
*?Desc
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4672??2009-04-04?14:22??driver\ADC.c
?????文件???????2955??2009-04-04?12:15??driver\ADC.h
?????文件???????3379??2009-04-04?14:03??driver\Delay.c
?????文件???????2968??2009-04-04?12:15??driver\Delay.h
?????文件???????3576??2009-04-04?14:09??driver\eeprom.c
?????文件???????2655??2009-04-04?12:15??driver\eeprom.h
?????文件???????8321??2009-04-04?14:03??driver\iic.c
?????文件???????2410??2009-03-10?09:49??driver\iic.h
?????文件???????2857??2009-04-04?16:10??driver\key.c
?????文件???????2198??2009-04-04?15:47??driver\key.h
?????文件???????6644??2009-04-04?14:03??driver\LCD.c
?????文件???????7152??2009-04-04?12:15??driver\LCD.h
?????文件???????4172??2009-04-04?14:43??driver\other.c
?????文件???????3677??2009-04-04?14:48??driver\other.h
?????文件???????6447??2009-04-04?14:24??driver\RTC.c
?????文件???????5372??2009-04-04?12:15??driver\RTC.h
?????文件???????5359??2009-04-04?14:22??driver\spi.c
?????文件???????3851??2009-04-04?12:15??driver\spi.h
?????文件??????14082??2009-04-04?14:04??driver\SPIFlash.c
?????文件???????6773??2009-04-04?12:16??driver\SPIFlash.h
?????文件???????6738??2009-04-04?14:04??driver\system.c
?????文件???????2561??2009-04-04?12:15??driver\system.h
?????文件??????12521??2009-04-04?14:22??driver\timer.c
?????文件???????8663??2009-04-04?12:15??driver\timer.h
?????文件??????12750??2009-12-24?15:29??driver\Uart.#2
?????文件???????8699??2009-04-04?12:15??driver\Uart.h
?????文件????????141??2009-12-24?15:33??driver\tmp.out
?????文件??????22733??2009-12-24?15:33??driver\Uart.LST
?????文件??????12777??2009-12-24?15:31??driver\Uart.#1
?????文件??????13481??2009-12-24?15:33??driver\Uart.OBJ
............此處省略31個文件信息
評論
共有 條評論