uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ADC Private Macros

Macros

#define ADC_CR_CH_SEL(n)   ((1UL << n))
 
#define ADC_CR_CLKDIV(n)   ((n<<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_EINT0   ((2UL<<24))
 
#define ADC_CR_START_CAP01   ((3UL<<24))
 
#define ADC_CR_START_MAT01   ((4UL<<24))
 
#define ADC_CR_START_MAT03   ((5UL<<24))
 
#define ADC_CR_START_MAT10   ((6UL<<24))
 
#define ADC_CR_START_MAT11   ((7UL<<24))
 
#define ADC_CR_EDGE   ((1UL<<27))
 
#define ADC_GDR_RESULT(n)   (((n>>4)&0xFFF))
 
#define ADC_GDR_CH(n)   (((n>>24)&0x7))
 
#define ADC_GDR_OVERRUN_FLAG   ((1UL<<30))
 
#define ADC_GDR_DONE_FLAG   ((1UL<<31))
 
#define ADC_GDR_CH_MASK   ((7UL<<24))
 
#define ADC_INTEN_CH(n)   ((1UL<<n))
 
#define ADC_INTEN_GLOBAL   ((1UL<<8))
 
#define ADC_DR_RESULT(n)   (((n>>4)&0xFFF))
 
#define ADC_DR_OVERRUN_FLAG   ((1UL<<30))
 
#define ADC_DR_DONE_FLAG   ((1UL<<31))
 
#define ADC_STAT_CH_DONE_FLAG(n)   ((n&0xFF))
 
#define ADC_STAT_CH_OVERRUN_FLAG(n)   (((n>>8)&0xFF))
 
#define ADC_STAT_INT_FLAG   ((1UL<<16))
 
#define ADC_ADCOFFS(n)   (((n&0xF)<<4))
 
#define ADC_TRIM(n)   (((n&0xF)<<8))
 
#define PARAM_ADCx(n)   (((uint32_t *)n)==((uint32_t *)LPC_ADC))
 
#define PARAM_ADC_START_ON_EDGE_OPT(OPT)   ((OPT == ADC_START_ON_RISING)||(OPT == ADC_START_ON_FALLING))
 
#define PARAM_ADC_DATA_STATUS(OPT)   ((OPT== ADC_DATA_BURST)||(OPT== ADC_DATA_DONE))
 
#define PARAM_ADC_RATE(rate)   ((rate>0)&&(rate<=200000))
 
#define PARAM_ADC_CHANNEL_SELECTION(SEL)
 
#define PARAM_ADC_START_OPT(OPT)
 
#define PARAM_ADC_TYPE_INT_OPT(OPT)
 

Detailed Description

Macro Definition Documentation

#define ADC_ADCOFFS (   n)    (((n&0xF)<<4))

Macro defines for ADC Trim registerOffset trim bits for ADC operation

Definition at line 131 of file lpc17xx_adc.h.

#define ADC_CR_BURST   ((1UL<<16))

Repeated conversions A/D enable bit

Definition at line 55 of file lpc17xx_adc.h.

#define ADC_CR_CH_SEL (   n)    ((1UL << n))

Macro defines for ADC control registerSelects which of the AD0.0:7 pins is (are) to be sampled and converted

Definition at line 50 of file lpc17xx_adc.h.

#define ADC_CR_CLKDIV (   n)    ((n<<8))

The APB clock (PCLK) is divided by (this value plus one) to produce the clock for the A/D

Definition at line 53 of file lpc17xx_adc.h.

#define ADC_CR_EDGE   ((1UL<<27))

Start conversion on a falling edge on the selected CAP/MAT signal

Definition at line 77 of file lpc17xx_adc.h.

#define ADC_CR_PDN   ((1UL<<21))

ADC convert in power down mode

Definition at line 57 of file lpc17xx_adc.h.

#define ADC_CR_START_CAP01   ((3UL<<24))

Start conversion when the edge selected by bit 27 occurs on P1.27/CAP0.1

Definition at line 67 of file lpc17xx_adc.h.

#define ADC_CR_START_EINT0   ((2UL<<24))

Start conversion when the edge selected by bit 27 occurs on P2.10/EINT0

Definition at line 65 of file lpc17xx_adc.h.

#define ADC_CR_START_MASK   ((7UL<<24))

Start mask bits

Definition at line 59 of file lpc17xx_adc.h.

#define ADC_CR_START_MAT01   ((4UL<<24))

Start conversion when the edge selected by bit 27 occurs on MAT0.1

Definition at line 69 of file lpc17xx_adc.h.

#define ADC_CR_START_MAT03   ((5UL<<24))

Start conversion when the edge selected by bit 27 occurs on MAT0.3

Definition at line 71 of file lpc17xx_adc.h.

#define ADC_CR_START_MAT10   ((6UL<<24))

Start conversion when the edge selected by bit 27 occurs on MAT1.0

Definition at line 73 of file lpc17xx_adc.h.

#define ADC_CR_START_MAT11   ((7UL<<24))

Start conversion when the edge selected by bit 27 occurs on MAT1.1

Definition at line 75 of file lpc17xx_adc.h.

#define ADC_CR_START_MODE_SEL (   SEL)    ((SEL<<24))

Select Start Mode

Definition at line 61 of file lpc17xx_adc.h.

#define ADC_CR_START_NOW   ((1UL<<24))

Start conversion now

Definition at line 63 of file lpc17xx_adc.h.

#define ADC_DR_DONE_FLAG   ((1UL<<31))

This bit is set to 1 when an A/D conversion completes. It is cleared when this register is read

Definition at line 113 of file lpc17xx_adc.h.

#define ADC_DR_OVERRUN_FLAG   ((1UL<<30))

These bits mirror the OVERRRUN status flags that appear in the result register for each A/D channel

Definition at line 110 of file lpc17xx_adc.h.

#define ADC_DR_RESULT (   n)    (((n>>4)&0xFFF))

Macro defines for ADC Data registerWhen DONE is 1, this field contains result value of ADC conversion

Definition at line 107 of file lpc17xx_adc.h.

#define ADC_GDR_CH (   n)    (((n>>24)&0x7))

These bits contain the channel from which the LS bits were converted

Definition at line 85 of file lpc17xx_adc.h.

#define ADC_GDR_CH_MASK   ((7UL<<24))

This bits is used to mask for Channel

Definition at line 93 of file lpc17xx_adc.h.

#define ADC_GDR_DONE_FLAG   ((1UL<<31))

This bit is set to 1 when an A/D conversion completes

Definition at line 90 of file lpc17xx_adc.h.

#define ADC_GDR_OVERRUN_FLAG   ((1UL<<30))

This bit is 1 in burst mode if the results of one or more conversions was (were) lost

Definition at line 88 of file lpc17xx_adc.h.

#define ADC_GDR_RESULT (   n)    (((n>>4)&0xFFF))

Macro defines for ADC Global Data registerWhen DONE is 1, this field contains result value of ADC conversion

Definition at line 83 of file lpc17xx_adc.h.

#define ADC_INTEN_CH (   n)    ((1UL<<n))

Macro defines for ADC Interrupt register These bits allow control over which A/D channels generate interrupts for conversion completion

Definition at line 99 of file lpc17xx_adc.h.

#define ADC_INTEN_GLOBAL   ((1UL<<8))

When 1, enables the global DONE flag in ADDR to generate an interrupt

Definition at line 101 of file lpc17xx_adc.h.

#define ADC_STAT_CH_DONE_FLAG (   n)    ((n&0xFF))

Macro defines for ADC Status register These bits mirror the DONE status flags that appear in the result register for each A/D channel

Definition at line 120 of file lpc17xx_adc.h.

#define ADC_STAT_CH_OVERRUN_FLAG (   n)    (((n>>8)&0xFF))

These bits mirror the OVERRRUN status flags that appear in the result register for each A/D channel

Definition at line 123 of file lpc17xx_adc.h.

#define ADC_STAT_INT_FLAG   ((1UL<<16))

This bit is the A/D interrupt flag

Definition at line 125 of file lpc17xx_adc.h.

#define ADC_TRIM (   n)    (((n&0xF)<<8))

Written to boot code

Definition at line 133 of file lpc17xx_adc.h.

#define PARAM_ADC_CHANNEL_SELECTION (   SEL)
Value:

Check ADC channel selection parameter

Definition at line 149 of file lpc17xx_adc.h.

#define PARAM_ADC_DATA_STATUS (   OPT)    ((OPT== ADC_DATA_BURST)||(OPT== ADC_DATA_DONE))

Check ADC state parameter

Definition at line 143 of file lpc17xx_adc.h.

#define PARAM_ADC_RATE (   rate)    ((rate>0)&&(rate<=200000))

Check ADC rate parameter

Definition at line 146 of file lpc17xx_adc.h.

#define PARAM_ADC_START_ON_EDGE_OPT (   OPT)    ((OPT == ADC_START_ON_RISING)||(OPT == ADC_START_ON_FALLING))

Check ADC state parameter

Definition at line 140 of file lpc17xx_adc.h.

#define PARAM_ADC_START_OPT (   OPT)
Value:
((OPT == ADC_START_CONTINUOUS)||(OPT == ADC_START_NOW)\

Check ADC start option parameter

Definition at line 155 of file lpc17xx_adc.h.

#define PARAM_ADC_TYPE_INT_OPT (   OPT)
Value:
((OPT == ADC_ADINTEN0)||(OPT == ADC_ADINTEN1)\
||(OPT == ADC_ADINTEN2)||(OPT == ADC_ADINTEN3)\
||(OPT == ADC_ADINTEN4)||(OPT == ADC_ADINTEN5)\
||(OPT == ADC_ADINTEN6)||(OPT == ADC_ADINTEN7)\
||(OPT == ADC_ADGINTEN))

Check ADC interrupt type parameter

Definition at line 161 of file lpc17xx_adc.h.

#define PARAM_ADCx (   n)    (((uint32_t *)n)==((uint32_t *)LPC_ADC))

Check ADC parameter

Definition at line 137 of file lpc17xx_adc.h.