![]() |
LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
|
Data Structures | |
struct | ADC_Clock_Setup_Type |
Enumerations | |
enum | ADC_Channel { ADC_CH0 = 0, ADC_CH1, ADC_CH2, ADC_CH3, ADC_CH4, ADC_CH5, ADC_CH6, ADC_CH7 } |
enum | ADC_Resolution { ADC_10BITS = 0, ADC_9BITS, ADC_8BITS, ADC_7BITS, ADC_6BITS, ADC_5BITS, ADC_4BITS, ADC_3BITS } |
enum | ADC_EdgeCfg { ADC_TRIGGERMODE_RISING = 0, ADC_TRIGGERMODE_FALLING } |
enum | ADC_StartMode { 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 | |
STATIC INLINE Status | Chip_ADC_Read_Value (LPC_ADC_Type *pADC, uint8_t channel, uint16_t *data) |
Read the ADC value from a channel. | |
STATIC INLINE FlagStatus | Chip_ADC_Read_Status (LPC_ADC_Type *pADC, uint8_t channel, uint32_t StatusType) |
Read the ADC channel status. | |
STATIC INLINE void | Chip_ADC_Channel_Int_Cmd (LPC_ADC_Type *pADC, uint8_t channel, FunctionalState NewState) |
Enable/Disable interrupt for ADC channel. | |
STATIC INLINE void | Chip_ADC_Global_Int_Cmd (LPC_ADC_Type *pADC, FunctionalState NewState) |
Enable/Disable global interrupt for ADC channel. | |
STATIC INLINE void | Chip_ADC_DeInit (LPC_ADC_Type *pADC) |
Shutdown ADC. | |
void | Chip_ADC_Init (LPC_ADC_Type *pADC, ADC_Clock_Setup_Type *ADCSetup) |
Initialize the ADC peripheral and the ADC setup structure to default value. | |
void | Chip_ADC_Set_StartMode (LPC_ADC_Type *pADC, ADC_StartMode mode, ADC_EdgeCfg EdgeOption) |
Select the mode starting the AD conversion. | |
void | Chip_ADC_Set_SampleRate (LPC_ADC_Type *pADC, ADC_Clock_Setup_Type *ADCSetup, uint32_t rate) |
Set the ADC Sample rate. | |
void | Chip_ADC_Set_Resolution (LPC_ADC_Type *pADC, ADC_Clock_Setup_Type *ADCSetup, ADC_Resolution resolution) |
Set the ADC accuracy bits. | |
void | Chip_ADC_Channel_Enable_Cmd (LPC_ADC_Type *pADC, ADC_Channel channel, FunctionalState NewState) |
Enable or disable the ADC channel on ADC peripheral. | |
void | Chip_ADC_Burst_Cmd (LPC_ADC_Type *pADC, FunctionalState NewState) |
Enable burst mode. | |
Status | Chip_ADC_Read_Byte (LPC_ADC_Type *pADC, uint8_t *data) |
Read the ADC value and convert it to 8bits value. | |
void | Chip_ADC_Active_Channel (uint8_t channel) |
Set a channel to be read A/D data. | |
enum ADC_Channel |
The channels on one ADC peripheral
ADC_CH0 |
ADC channel 0 |
ADC_CH1 |
ADC channel 1 |
ADC_CH2 |
ADC channel 2 |
ADC_CH3 |
ADC channel 3 |
ADC_CH4 |
ADC channel 4 |
ADC_CH5 |
ADC channel 5 |
ADC_CH6 |
ADC channel 6 |
ADC_CH7 |
ADC channel 7 |
Definition at line 47 of file adc_18xx_43xx.h.
enum ADC_EdgeCfg |
Edge configuration, which controls rising or falling edge on the selected signal for the start of a conversion
ADC_TRIGGERMODE_RISING |
Trigger event: rising edge |
ADC_TRIGGERMODE_FALLING |
Trigger event: falling edge |
Definition at line 71 of file adc_18xx_43xx.h.
enum ADC_Resolution |
The number of bits of accuracy of the result in the LS bits of ADDR
ADC_10BITS |
ADC 10 bits |
ADC_9BITS |
ADC 9 bits |
ADC_8BITS |
ADC 8 bits |
ADC_7BITS |
ADC 7 bits |
ADC_6BITS |
ADC 6 bits |
ADC_5BITS |
ADC 5 bits |
ADC_4BITS |
ADC 4 bits |
ADC_3BITS |
ADC 3 bits |
Definition at line 59 of file adc_18xx_43xx.h.
enum ADC_StartMode |
Start mode, which controls the start of an A/D conversion when the BURST bit is 0.
Definition at line 77 of file adc_18xx_43xx.h.
void Chip_ADC_Active_Channel | ( | uint8_t | channel | ) |
Set a channel to be read A/D data.
channel | : Channel to be active |
Definition at line 133 of file adc_18xx_43xx.c.
void Chip_ADC_Burst_Cmd | ( | LPC_ADC_Type * | pADC, |
FunctionalState | NewState | ||
) |
Enable burst mode.
pADC | : The base of ADC peripheral on the chip |
NewState | : New state, should be:
|
Definition at line 114 of file adc_18xx_43xx.c.
void Chip_ADC_Channel_Enable_Cmd | ( | LPC_ADC_Type * | pADC, |
ADC_Channel | channel, | ||
FunctionalState | NewState | ||
) |
Enable or disable the ADC channel on ADC peripheral.
pADC | : The base of ADC peripheral on the chip |
channel | : Channel to be enable or disable |
NewState | : New state, should be:
|
Definition at line 107 of file adc_18xx_43xx.c.
STATIC INLINE void Chip_ADC_Channel_Int_Cmd | ( | LPC_ADC_Type * | pADC, |
uint8_t | channel, | ||
FunctionalState | NewState | ||
) |
Enable/Disable interrupt for ADC channel.
pADC | : The base of ADC peripheral on the chip |
channel | : ADC channel to read |
NewState | : New state, ENABLE or DISABLE |
Definition at line 125 of file adc_18xx_43xx.h.
STATIC INLINE void Chip_ADC_DeInit | ( | LPC_ADC_Type * | pADC | ) |
Shutdown ADC.
pADC | : The base of ADC peripheral on the chip |
Definition at line 146 of file adc_18xx_43xx.h.
STATIC INLINE void Chip_ADC_Global_Int_Cmd | ( | LPC_ADC_Type * | pADC, |
FunctionalState | NewState | ||
) |
Enable/Disable global interrupt for ADC channel.
pADC | : The base of ADC peripheral on the chip |
NewState | : New state, ENABLE or DISABLE |
Definition at line 136 of file adc_18xx_43xx.h.
void Chip_ADC_Init | ( | LPC_ADC_Type * | pADC, |
ADC_Clock_Setup_Type * | ADCSetup | ||
) |
Initialize the ADC peripheral and the ADC setup structure to default value.
pADC | : The base of ADC peripheral on the chip |
ADCSetup | : ADC setup structure to be set |
Definition at line 69 of file adc_18xx_43xx.c.
Status Chip_ADC_Read_Byte | ( | LPC_ADC_Type * | pADC, |
uint8_t * | data | ||
) |
Read the ADC value and convert it to 8bits value.
pADC | : The base of ADC peripheral on the chip |
data | : Storage for data |
Definition at line 121 of file adc_18xx_43xx.c.
STATIC INLINE FlagStatus Chip_ADC_Read_Status | ( | LPC_ADC_Type * | pADC, |
uint8_t | channel, | ||
uint32_t | StatusType | ||
) |
Read the ADC channel status.
pADC | : The base of ADC peripheral on the chip |
channel | : ADC channel to read |
StatusType | : Status type of ADC_DR_* |
Definition at line 113 of file adc_18xx_43xx.h.
STATIC INLINE Status Chip_ADC_Read_Value | ( | LPC_ADC_Type * | pADC, |
uint8_t | channel, | ||
uint16_t * | data | ||
) |
Read the ADC value from a channel.
pADC | : The base of ADC peripheral on the chip |
channel | : ADC channel to read |
data | : Pointer to where to put data |
Definition at line 101 of file adc_18xx_43xx.h.
void Chip_ADC_Set_Resolution | ( | LPC_ADC_Type * | pADC, |
ADC_Clock_Setup_Type * | ADCSetup, | ||
ADC_Resolution | resolution | ||
) |
Set the ADC accuracy bits.
pADC | : The base of ADC peripheral on the chip |
ADCSetup | : ADC setup structure to be modified |
resolution | : The resolution, should be ADC_10BITS -> ADC_3BITS |
Definition at line 100 of file adc_18xx_43xx.c.
void Chip_ADC_Set_SampleRate | ( | LPC_ADC_Type * | pADC, |
ADC_Clock_Setup_Type * | ADCSetup, | ||
uint32_t | rate | ||
) |
Set the ADC Sample rate.
pADC | : The base of ADC peripheral on the chip |
ADCSetup | : ADC setup structure to be modified |
rate | : Sample rate, should be set so the clock for A/D converter is less than or equal to 4.5MHz. |
Definition at line 92 of file adc_18xx_43xx.c.
void Chip_ADC_Set_StartMode | ( | LPC_ADC_Type * | pADC, |
ADC_StartMode | mode, | ||
ADC_EdgeCfg | EdgeOption | ||
) |
Select the mode starting the AD conversion.
pADC | : The base of ADC peripheral on the chip |
mode | : Stating mode, should be :
|
EdgeOption | : Stating Edge Condition, should be :
|
Definition at line 83 of file adc_18xx_43xx.c.