adc.h.svn-base

来自「Spearhead2000 的 USB驱动程序」· SVN-BASE 代码 · 共 53 行

SVN-BASE
53
字号
/*****************************************************************************//*                                                                           *//* -- File:                  adc.h                                           *//* -- Author:                Maurizio Costagliola      			     *//* -- Description:           Header ADC                                      *//*                                                                           *//* -- Modification History: - 1.0                                            *//*****************************************************************************/#ifdef __cplusplusextern  "C" {           /* C declarations in C++ */#endif#define ADC_BASE 0x1200B000typedef struct ADCController{  unsigned int ADC_STATUS_REG;  unsigned int AVERAGE_REG;     unsigned int N_SAMPLE_REG;    unsigned int ADC_CLK_REG;   } ADCController;#define ADCCntl ((volatile struct ADCController*) (ADC_BASE))/* Fields position *//* Control values *//* STATUS_REG */#define MASK_EN            0x00000001 //EN #define MASK_CHANNEL       0x00000001 //mask bit 1#define MASK_SAMPLE        0x00000080 //mask bit 2#define INT_ENA            0x80000000 //interrupt enable#define MASK_ADC_STATUS_INIT 0x00000066 //EN /* STATUS_REG */#define INT_CLR         0xFFFFFFFE //clear: int clear; read: int status#define INT_BIT         0x00000100 //clear: int clear; read: int statusextern void reg_read(void);extern void adc_init(void);extern void adc_test(void);#ifdef __cplusplus} /* C declarations in C++ */#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?