ADC library for the lpc176x bsp.  
More...
#include <bsp.h>
#include <bsp/io.h>
#include <bsp/lpc176x.h>
#include <bsp/adc.h>
 
Go to the source code of this file.
 | 
| 
#define  | MAX_ADC_CLK   13000000u | 
|   | 
| 
#define  | ADC_RANGE   0xFFFu | 
|   | 
| #define  | ADC_NUMBER_VALID(number) | 
|   | 
| 
#define  | ADC_CR_SEL(val)   BSP_FLD32( val, 0, 7 ) | 
|   | 
| 
#define  | ADC_CR_SEL_GET(val)   BSP_FLD32GET( val, 0, 7 ) | 
|   | 
| 
#define  | ADC_CR_SEL_SET(reg,  val)   BSP_FLD32SET( reg, val, 0, 7 ) | 
|   | 
| 
#define  | ADC_CR_CLKDIV(val)   BSP_FLD32( val, 8, 15 ) | 
|   | 
| 
#define  | ADC_CR_CLKDIV_GET(reg)   BSP_FLD32GET( reg, 8, 15 ) | 
|   | 
| 
#define  | ADC_CR_CLKDIV_SET(reg,  val)   BSP_FLD32SET( reg, val, 8, 15 ) | 
|   | 
| 
#define  | ADC_CR_BURST   BSP_BIT32( 16 ) | 
|   | 
| 
#define  | ADC_CR_CLKS(val)   BSP_FLD32( val, 17, 19 ) | 
|   | 
| 
#define  | ADC_CR_PDN   BSP_BIT32( 21 ) | 
|   | 
| 
#define  | ADC_CR_START_NOW   BSP_BIT32( 24 ) | 
|   | 
| 
#define  | ADC_CR_START(val)   BSP_FLD32( val, 24, 26 ) | 
|   | 
| 
#define  | ADC_CR_EDGE   BSP_BIT32( 27 ) | 
|   | 
| 
#define  | ADC_DR_VALUE(reg)   BSP_FLD32GET( reg, 4, 15 ) | 
|   | 
| 
#define  | ADC_DR_OVERRUN   BSP_BIT32( 30 ) | 
|   | 
| 
#define  | ADC_DR_DONE   BSP_BIT32( 31 ) | 
|   | 
| 
#define  | ADC_DATA_CONVERSION_DONE(val)   ( ( val & ADC_DR_DONE ) != 0u ) | 
|   | 
 | 
| enum   | lpc176x_adc_number {  
  ADC_0, 
ADC_1, 
ADC_2, 
ADC_3, 
 
  ADC_4, 
ADC_5, 
ADC_6, 
ADC_7, 
 
  ADC_DEVICES_COUNT
 
 } | 
|   | The ADC inputs of the board. 
  | 
|   | 
ADC library for the lpc176x bsp. 
 
◆ ADC_NUMBER_VALID
      
        
          | #define ADC_NUMBER_VALID | 
          ( | 
            | 
          number | ) | 
           | 
        
      
 
Value:( ( (uint32_t) number ) < \
                                     ADC_DEVICES_COUNT )