18#ifndef LPC176X_ADC_DEFS_H
19#define LPC176X_ADC_DEFS_H
45#define MAX_ADC_CLK 13000000u
47#define ADC_RANGE 0xFFFu
49#define ADC_NUMBER_VALID( number ) ( ( (uint32_t) number ) < \
52#define ADC_CR_SEL( val ) BSP_FLD32( val, 0, 7 )
53#define ADC_CR_SEL_GET( val ) BSP_FLD32GET( val, 0, 7 )
54#define ADC_CR_SEL_SET( reg, val ) BSP_FLD32SET( reg, val, 0, 7 )
55#define ADC_CR_CLKDIV( val ) BSP_FLD32( val, 8, 15 )
56#define ADC_CR_CLKDIV_GET( reg ) BSP_FLD32GET( reg, 8, 15 )
57#define ADC_CR_CLKDIV_SET( reg, val ) BSP_FLD32SET( reg, val, 8, 15 )
58#define ADC_CR_BURST BSP_BIT32( 16 )
59#define ADC_CR_CLKS( val ) BSP_FLD32( val, 17, 19 )
60#define ADC_CR_PDN BSP_BIT32( 21 )
61#define ADC_CR_START_NOW BSP_BIT32( 24 )
62#define ADC_CR_START( val ) BSP_FLD32( val, 24, 26 )
63#define ADC_CR_EDGE BSP_BIT32( 27 )
65#define ADC_DR_VALUE( reg ) BSP_FLD32GET( reg, 4, 15 )
66#define ADC_DR_OVERRUN BSP_BIT32( 30 )
67#define ADC_DR_DONE BSP_BIT32( 31 )
69#define ADC_DATA_CONVERSION_DONE( val ) ( ( val & ADC_DR_DONE ) != 0u )
75 volatile uint32_t ADCR;
76 volatile uint32_t ADGDR;
77 volatile uint32_t RESERVED0;
78 volatile uint32_t ADINTEN;
79 volatile uint32_t ADDR[ ADC_DEVICES_COUNT ];
80 volatile uint32_t ADSTAT;
81 volatile uint32_t ADTRM;
lpc176x_adc_number
The ADC inputs of the board.
Definition: adc-defs.h:33
lpc176x_pin_function
Defines the functions according to the pin.
Definition: io-defs.h:68
ADC library for the lpc176x bsp.
Specific register definitions according to lpc176x family boards.
The ADC low-level device.
Definition: adc-defs.h:74
Represents the pin and function for each ADC input.
Definition: adc-defs.h:87