周立功的一本书上《ARM&WinCE实验与实践-基于S3C2410》好多例程的头文件都是要光盘的,
adc.h 这个是AD采集的,
不地道之处就在于买书不给配盘,
必须买MagicARM2410才有盘。我的是FriendlyARM SBC2410的
谁有看过这本书的,或者谁有光盘的我可以拿FirendlyARM的内容交换~~
/****************************************Copyright (c)**************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.zyinside.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: adc.h
** Last modified Date: 2006.10.09
** Last Version: V1.0
** Description: adc.h, S3C2410A 自带 A/D 转换器驱动程序头文件
** adc.h, the head file of A/D driver of the S3C2410A A/D converter
**------------------------------------------------------------------------------------------------------
** Created By: MingYuan Zheng 郑明远
** Created date: 2006.10.09
** Version: V1.0
** Descriptions: The original version 初始版本
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Description:
**
********************************************************************************************************/
#ifndef __ADC_H__
#define __ADC_H__
#ifdef __cplusplus
extern "C" {
#endif
#define IOCTL_SET_ADC_CHANNEL 0x01
#define IOCTL_SET_ADC_FREQUENCY 0x02
#define IOCTL_GET_ADC_CURFREQ 0x03
#define IOCTL_SET_ADC_MAXFREQ 0x04
#define IOCTL_SET_ADC_MINFREQ 0x05
// ADCCON 寄存器
#define ADCCON_EN_START (1 << 0)
#define ADCCON_DIS_START (0 << 0)
#define ADCCON_DIS_READSTART (0 << 1)
#define ADCCON_EN_READSTART (1 << 1)
#define ADCCON_NORMAL_MODE (0 << 2)
#define ADCCON_STANDBY_MODE (1 << 2)
#define ADCCON_CHANNEL_MSK (0x07 << 3)
#define ADCCON_CHANNEL_0 0
#define ADCCON_CHANNEL_1 1
#define ADCCON_CHANNEL_2 2
#define ADCCON_CHANNEL_3 3
#define ADCCON_CHANNEL_4 4
#define ADCCON_CHANNEL_5 5
#define ADCCON_CHANNEL_6 6
#define ADCCON_CHANNEL_7 7
#define ADCCON_PRSCVL_MSK (0xFF << 6)
#define ADCCON_PRSCEN_EN (1 << 14)
#define ADCCON_PRSCEN_DIS (0 << 14)
#define ADCCIN_CONVERTING (0 << 15)
#define ADCCIN_CONVERT_END (1 << 15)
// ADCTSC 寄存器
#define ADCTSC_NORMAL_MODE (0x3 << 0)
#ifdef __cplusplus
}
#endif
#endif // __ADC_H__