LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
adc_001.h File Reference
#include "sys_config.h"
#include "cmsis.h"

Go to the source code of this file.

Data Structures

struct  IP_ADC_001_Type
 10 or 12-bit ADC register block structure More...
 

Macros

#define ADC_DR_RESULT(n)   ((((n) >> 6) & 0x3FF))
 ADC register support bitfields and mask.
 
#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_BITACC(n)   ((((n) & 0x7) << 17))
 
#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))
 

Enumerations

enum  IP_ADC_Status { ADC_DR_DONE_STAT, ADC_DR_OVERRUN_STAT, ADC_DR_ADINT_STAT }
 ADC status register used for IP drivers. More...
 

Functions

void IP_ADC_Init (IP_ADC_001_Type *pADC, uint32_t adcRate, uint32_t adcPerClock, uint8_t bitsAccuracy)
 Initialize for ADC.
 
void IP_ADC_DeInit (IP_ADC_001_Type *pADC)
 Shutdown ADC.
 
void IP_ADC_SetBurstMode (IP_ADC_001_Type *pADC, FunctionalState NewState)
 Set burst mode for ADC.
 
Status IP_ADC_Get_Val (IP_ADC_001_Type *pADC, uint8_t channel, uint16_t *data)
 Get the ADC value.
 
FlagStatus IP_ADC_GetStatus (IP_ADC_001_Type *pADC, uint8_t channel, uint32_t StatusType)
 Get ADC Channel status from ADC data register.
 
void IP_ADC_EdgeStartConfig (IP_ADC_001_Type *pADC, uint8_t edge_mode)
 Set the edge start condition.
 
void IP_ADC_SetChannelNumber (IP_ADC_001_Type *pADC, uint8_t channel, FunctionalState NewState)
 Enable/Disable ADC channel number.
 
void IP_ADC_SetStartMode (IP_ADC_001_Type *pADC, uint8_t start_mode)
 Set start mode for ADC.
 
void IP_ADC_Int_Enable (IP_ADC_001_Type *pADC, uint8_t channel, FunctionalState NewState)
 Enable/Disable interrupt for ADC channel.