Go to the source code of this file.
Classes | |
struct | ADC_CLOCK_SETUP_T |
struct | LPC_ADC_T |
10 or 12-bit ADC register block structure More... | |
Macros | |
#define | ADC_CR_BITACC(n) ((((n) & 0x7) << 17)) |
#define | ADC_CR_BURST ((1UL << 16)) |
#define | ADC_CR_CH_SEL(n) ((1UL << (n))) |
#define | ADC_CR_CLKDIV(n) ((((n) & 0xFF) << 8)) |
#define | ADC_CR_EDGE ((1UL << 27)) |
#define | ADC_CR_PDN ((1UL << 21)) |
#define | ADC_CR_START_ADCTRIG0 ((4UL << 24)) |
#define | ADC_CR_START_ADCTRIG1 ((5UL << 24)) |
#define | ADC_CR_START_CTOUT15 ((2UL << 24)) |
#define | ADC_CR_START_CTOUT8 ((3UL << 24)) |
#define | ADC_CR_START_MASK ((7UL << 24)) |
#define | ADC_CR_START_MCOA2 ((6UL << 24)) |
#define | ADC_CR_START_MODE_SEL(SEL) ((SEL << 24)) |
#define | ADC_CR_START_NOW ((1UL << 24)) |
#define | ADC_DR_DONE(n) (((n) >> 31)) |
#define | ADC_DR_OVERRUN(n) ((((n) >> 30) & (1UL))) |
#define | ADC_DR_RESULT(n) ((((n) >> 6) & 0x3FF)) |
ADC register support bitfields and mask. More... | |
#define | ADC_MAX_SAMPLE_RATE 400000 |
#define | ADC_SAMPLE_RATE_CONFIG_MASK (ADC_CR_CLKDIV(0xFF) | ADC_CR_BITACC(0x07)) |
Typedefs | |
typedef enum CHIP_ADC_CHANNEL | ADC_CHANNEL_T |
typedef enum CHIP_ADC_EDGE_CFG | ADC_EDGE_CFG_T |
typedef enum CHIP_ADC_RESOLUTION | ADC_RESOLUTION_T |
typedef enum CHIP_ADC_START_MODE | ADC_START_MODE_T |
typedef enum IP_ADC_STATUS | ADC_STATUS_T |
ADC status register used for IP drivers. More... | |
Enumerations | |
enum | CHIP_ADC_CHANNEL { ADC_CH0 = 0, ADC_CH1, ADC_CH2, ADC_CH3, ADC_CH4, ADC_CH5, ADC_CH6, ADC_CH7 } |
enum | CHIP_ADC_EDGE_CFG { ADC_TRIGGERMODE_RISING = 0, ADC_TRIGGERMODE_FALLING } |
enum | CHIP_ADC_RESOLUTION { ADC_10BITS = 0, ADC_9BITS, ADC_8BITS, ADC_7BITS, ADC_6BITS, ADC_5BITS, ADC_4BITS, ADC_3BITS } |
enum | CHIP_ADC_START_MODE { 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 } |
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 | Chip_ADC_DeInit (LPC_ADC_T *pADC) |
Shutdown ADC. 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_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_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... | |
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... | |
Status | Chip_ADC_ReadValue (LPC_ADC_T *pADC, uint8_t channel, uint16_t *data) |
Read the ADC value from a channel. More... | |
void | Chip_ADC_SetBurstCmd (LPC_ADC_T *pADC, FunctionalState NewState) |
Enable burst mode. 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_SetSampleRate (LPC_ADC_T *pADC, ADC_CLOCK_SETUP_T *ADCSetup, uint32_t rate) |
Set the ADC Sample rate. 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... | |