LPCOpen Platform for LPC18XX/43XX microcontrollers: C:/w/lpcopen_docs/software/lpc_core/lpc_chip/chip_18xx_43xx/adc_18xx_43xx.h File Reference

| LPCOpen Platform for LPC18XX/43XX microcontrollers 18XX43XX LPCOpen Platform for the NXP LPC18XX/43XX family of Microcontrollers

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Enumerations | Functions
adc_18xx_43xx.h File Reference

Go to the source code of this file.

## Data Structures
struct | LPC_ADC_T
| 10 or 12-bit ADC register block structure More...
struct | ADC_CLOCK_SETUP_T

## Macros
#define | ADC_ACC_10BITS
#define | ADC_MAX_SAMPLE_RATE 400000
#define | ADC_DR_RESULT(n) ((((n) >> 6) & 0x3FF))
| ADC register support bitfields and mask. More...
#define | ADC_CR_BITACC(n) ((((n) & 0x7) << 17))
#define | ADC_DR_DONE(n) (((n) >> 31))
#define | ADC_DR_OVERRUN(n) ((((n) >> 30) & (1UL)))
#define | ADC_CR_CH_SEL(n) ((1UL << (n)))
#define | ADC_CR_CLKDIV(n) ((((n) & 0xFF) << 8))
#define | ADC_CR_BURST ((1UL << 16))
#define | ADC_CR_PDN ((1UL << 21))
#define | ADC_CR_START_MASK ((7UL << 24))
#define | ADC_CR_START_MODE_SEL(SEL) ((SEL << 24))
#define | ADC_CR_START_NOW ((1UL << 24))
#define | ADC_CR_START_CTOUT15 ((2UL << 24))
#define | ADC_CR_START_CTOUT8 ((3UL << 24))
#define | ADC_CR_START_ADCTRIG0 ((4UL << 24))
#define | ADC_CR_START_ADCTRIG1 ((5UL << 24))
#define | ADC_CR_START_MCOA2 ((6UL << 24))
#define | ADC_CR_EDGE ((1UL << 27))
#define | ADC_SAMPLE_RATE_CONFIG_MASK (ADC_CR_CLKDIV(0xFF) | ADC_CR_BITACC(0x07))

## Enumerations
enum | ADC_STATUS_T { ADC_DR_DONE_STAT, ADC_DR_OVERRUN_STAT, ADC_DR_ADINT_STAT }
| ADC status register used for IP drivers. More...
enum | ADC_CHANNEL_T { ADC_CH0 = 0, ADC_CH1, ADC_CH2, ADC_CH3, ADC_CH4, ADC_CH5, ADC_CH6, ADC_CH7 }
enum | ADC_RESOLUTION_T { ADC_10BITS = 0, ADC_9BITS, ADC_8BITS, ADC_7BITS, ADC_6BITS, ADC_5BITS, ADC_4BITS, ADC_3BITS }
enum | ADC_EDGE_CFG_T { ADC_TRIGGERMODE_RISING = 0, ADC_TRIGGERMODE_FALLING }
enum | ADC_START_MODE_T { ADC_NO_START = 0, ADC_START_NOW, ADC_START_ON_CTOUT15, ADC_START_ON_CTOUT8, ADC_START_ON_ADCTRIG0, ADC_START_ON_ADCTRIG1, ADC_START_ON_MCOA2 }

## Functions
void | Chip_ADC_Init (LPC_ADC_T *pADC, ADC_CLOCK_SETUP_T *ADCSetup)
| Initialize the ADC peripheral and the ADC setup structure to default value. More...
void | Chip_ADC_DeInit (LPC_ADC_T *pADC)
| Shutdown ADC. More...
Status | Chip_ADC_ReadValue (LPC_ADC_T *pADC, uint8_t channel, uint16_t *data)
| Read the ADC value from a channel. More...
Status | Chip_ADC_ReadByte (LPC_ADC_T *pADC, ADC_CHANNEL_T channel, uint8_t *data)
| Read the ADC value and convert it to 8bits value. More...
FlagStatus | Chip_ADC_ReadStatus (LPC_ADC_T *pADC, uint8_t channel, uint32_t StatusType)
| Read the ADC channel status. More...
void | Chip_ADC_Int_SetChannelCmd (LPC_ADC_T *pADC, uint8_t channel, FunctionalState NewState)
| Enable/Disable interrupt for ADC channel. More...
STATIC INLINE void | Chip_ADC_Int_SetGlobalCmd (LPC_ADC_T *pADC, FunctionalState NewState)
| Enable/Disable global interrupt for ADC channel. More...
void | Chip_ADC_SetStartMode (LPC_ADC_T *pADC, ADC_START_MODE_T mode, ADC_EDGE_CFG_T EdgeOption)
| Select the mode starting the AD conversion. More...
void | Chip_ADC_SetSampleRate (LPC_ADC_T *pADC, ADC_CLOCK_SETUP_T *ADCSetup, uint32_t rate)
| Set the ADC Sample rate. More...
void | Chip_ADC_SetResolution (LPC_ADC_T *pADC, ADC_CLOCK_SETUP_T *ADCSetup, ADC_RESOLUTION_T resolution)
| Set the ADC accuracy bits. More...
void | Chip_ADC_EnableChannel (LPC_ADC_T *pADC, ADC_CHANNEL_T channel, FunctionalState NewState)
| Enable or disable the ADC channel on ADC peripheral. More...
void | Chip_ADC_SetBurstCmd (LPC_ADC_T *pADC, FunctionalState NewState)
| Enable burst mode. More...