Go to the documentation of this file.
35 #if !defined(CHIP_LPC1125)
47 #define ADC_MAX_SAMPLE_RATE 400000
64 #define ADC_DR_RESULT(n) ((((n) >> 6) & 0x3FF))
65 #define ADC_CR_BITACC(n) ((((n) & 0x7) << 17))
67 #define ADC_DR_DONE(n) (((n) >> 31))
68 #define ADC_DR_OVERRUN(n) ((((n) >> 30) & (1UL)))
69 #define ADC_CR_CH_SEL(n) ((1UL << (n)))
70 #define ADC_CR_CLKDIV(n) ((((n) & 0xFF) << 8))
71 #define ADC_CR_BURST ((1UL << 16))
72 #define ADC_CR_PDN ((1UL << 21))
73 #define ADC_CR_START_MASK ((7UL << 24))
74 #define ADC_CR_START_MODE_SEL(SEL) ((SEL << 24))
75 #define ADC_CR_START_NOW ((1UL << 24))
76 #define ADC_CR_START_CTOUT15 ((2UL << 24))
77 #define ADC_CR_START_CTOUT8 ((3UL << 24))
78 #define ADC_CR_START_ADCTRIG0 ((4UL << 24))
79 #define ADC_CR_START_ADCTRIG1 ((5UL << 24))
80 #define ADC_CR_START_MCOA2 ((6UL << 24))
81 #define ADC_CR_EDGE ((1UL << 27))
82 #define ADC_SAMPLE_RATE_CONFIG_MASK (ADC_CR_CLKDIV(0xFF) | ADC_CR_BITACC(0x07))
enum CHIP_ADC_CHANNEL ADC_CHANNEL_T
Status Chip_ADC_ReadValue(LPC_ADC_T *pADC, uint8_t channel, uint16_t *data)
Read the ADC value from a channel.
void Chip_ADC_DeInit(LPC_ADC_T *pADC)
Shutdown ADC.
@ ADC_TRIGGERMODE_FALLING
enum CHIP_ADC_EDGE_CFG ADC_EDGE_CFG_T
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.
FunctionalState
Functional State Definition.
10 or 12-bit ADC register block structure
FlagStatus Chip_ADC_ReadStatus(LPC_ADC_T *pADC, uint8_t channel, uint32_t StatusType)
Read the ADC channel status.
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.
void Chip_ADC_Int_SetChannelCmd(LPC_ADC_T *pADC, uint8_t channel, FunctionalState NewState)
Enable/Disable interrupt for ADC channel.
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.
enum CHIP_ADC_RESOLUTION ADC_RESOLUTION_T
enum IP_ADC_STATUS ADC_STATUS_T
ADC status register used for IP drivers.
void Chip_ADC_EnableChannel(LPC_ADC_T *pADC, ADC_CHANNEL_T channel, FunctionalState NewState)
Enable or disable the ADC channel on ADC peripheral.
STATIC INLINE void Chip_ADC_Int_SetGlobalCmd(LPC_ADC_T *pADC, FunctionalState NewState)
Enable/Disable global interrupt for ADC channel.
void Chip_ADC_SetSampleRate(LPC_ADC_T *pADC, ADC_CLOCK_SETUP_T *ADCSetup, uint32_t rate)
Set the ADC Sample rate.
enum CHIP_ADC_START_MODE ADC_START_MODE_T
void Chip_ADC_SetResolution(LPC_ADC_T *pADC, ADC_CLOCK_SETUP_T *ADCSetup, ADC_RESOLUTION_T resolution)
Set the ADC accuracy bits.
IP_ADC_STATUS
ADC status register used for IP drivers.
FlagStatus
Boolean Type definition.
void Chip_ADC_SetBurstCmd(LPC_ADC_T *pADC, FunctionalState NewState)
Enable burst mode.