Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# a2d.h

    00001 /*! \file a2d.h \brief Analog-to-Digital Converte Driver for LPC2000. */
    00002 //*****************************************************************************
    00003 //
    00004 // File Name    : 'a2d.h'
    00005 // Title        : Analog-to-Digital Converte Driver for LPC2000
    00006 // Author       : Pascal Stang - Copyright (C) 2006
    00007 // Created      : 2006.04.09
    00008 // Revised      : 2006.04.15
    00009 // Version      : 0.1
    00010 // Target MCU   : LPC2000 ARM processors
    00011 // Editor Tabs  : 4
    00012 //
    00013 // This code is distributed under the GNU Public License
    00014 //      which can be found at http://www.gnu.org/licenses/gpl.txt
    00015 //
    00016 //*****************************************************************************
    00017
    00018 #ifndef A2D_H
    00019 #define A2D_H
    00020
    00021 #include "global.h"
    00022
    00023 // register bits
    00024 #define ADCR_SEL_MASK       (0xFF)
    00025 #define ADCR_CLKDIV_MASK    (0xFF<<8)
    00026 #define ADCR_BURST          (1<<16)
    00027
    00028 #define ADCR_CLKS_10BIT     (0<<17)
    00029 #define ADCR_CLKS_9BIT      (1<<17)
    00030 #define ADCR_CLKS_8BIT      (2<<17)
    00031 #define ADCR_CLKS_7BIT      (3<<17)
    00032 #define ADCR_CLKS_6BIT      (4<<17)
    00033 #define ADCR_CLKS_5BIT      (5<<17)
    00034 #define ADCR_CLKS_4BIT      (6<<17)
    00035 #define ADCR_CLKS_3BIT      (7<<17)
    00036 #define ADCR_CLKS_MASK      (7<<17)
    00037
    00038 #define ADCR_PDN            (1<<21)
    00039
    00040 #define ADCR_START_NOW      (1<<24)
    00041 #define ADCR_START_MASK     (7<<24)
    00042
    00043 #define ADCR_EDGE           (1<<27)
    00044
    00045 #define ADDR_DONE           (1<<31)
    00046 #define ADDR_OVERUN         (1<<31)
    00047 #define ADDR_CHN_MASK       (7<<24)
    00048 #define ADDR_VALUE_MASK     (0xFFFF)
    00049
    00050 void a2dInit(void);
    00051 int a2dConvert(int channel);
    00052
    00053 #endif