X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fadc.c;h=18a2c0b9bccae7dd994e458e5c3763077ea6d342;hb=HEAD;hp=dffb9ce47f3b2ad488a4a6c4234161ed8371fcf0;hpb=bcf38f772b397e7a8ba781a69aacb9380e54b32a;p=bertos.git diff --git a/drv/adc.c b/drv/adc.c deleted file mode 100755 index dffb9ce4..00000000 --- a/drv/adc.c +++ /dev/null @@ -1,61 +0,0 @@ -/** - * \file - * - * - * \version $Id$ - * - * \brief ADC driver (implementation) - * - * \version $Id$ - * \author Francesco Sacchi - */ - -/*#* - *#* $Log$ - *#* Revision 1.2 2006/07/19 12:56:25 bernie - *#* Convert to new Doxygen style. - *#* - *#* Revision 1.1 2005/06/27 21:28:31 bernie - *#* Import ADC driver. - *#* - *#*/ - - -#include -#include -#include - -#include -#include -#include - -DB(bool adc_initialized = false;) - -/** - * Read the ADC channel \a ch. - */ -adcread_t adc_read(uint16_t ch) -{ - ASSERT(ch <= (uint16_t)ADC_MUX_MAXCH); - ch = MIN(ch, (uint16_t)ADC_MUX_MAXCH); - - adc_hw_select_ch(ch); - - return(adc_hw_read()); -} - -/** - * Initialize the ADC hardware. - */ -void adc_init(void) -{ - cpuflags_t flags; - IRQ_SAVE_DISABLE(flags); - - ADC_HW_INIT; - DB(adc_initialized = true;) - IRQ_RESTORE(flags); -}