NXP's driver library for LPC17xx, ported to mbed's online compiler. Not tested! I had to fix a lot of warings and found a couple of pretty obvious bugs, so the chances are there are more. Original: http://ics.nxp.com/support/documents/microcontrollers/zip/lpc17xx.cmsis.driver.library.zip

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

lpc17xx_adc.h File Reference

lpc17xx_adc.h File Reference

: Contains all macro definitions and function prototypes support for ADC firmware library on LPC17xx More...

Go to the source code of this file.

Enumerations

enum  ADC_CHANNEL_SELECTION {
  ADC_CHANNEL_0 = 0, ADC_CHANNEL_1, ADC_CHANNEL_2, ADC_CHANNEL_3,
  ADC_CHANNEL_4, ADC_CHANNEL_5, ADC_CHANNEL_6, ADC_CHANNEL_7
}
 

ADC enumeration.

More...
enum  ADC_START_OPT {
  ADC_START_CONTINUOUS = 0, ADC_START_NOW, ADC_START_ON_EINT0, ADC_START_ON_CAP01,
  ADC_START_ON_MAT01, ADC_START_ON_MAT03, ADC_START_ON_MAT10, ADC_START_ON_MAT11
}
 

Type of start option.

More...
enum  ADC_START_ON_EDGE_OPT { ADC_START_ON_RISING = 0, ADC_START_ON_FALLING }
 

Type of edge when start conversion on the selected CAP/MAT signal.

More...
enum  ADC_TYPE_INT_OPT {
  ADC_ADINTEN0 = 0, ADC_ADINTEN1, ADC_ADINTEN2, ADC_ADINTEN3,
  ADC_ADINTEN4, ADC_ADINTEN5, ADC_ADINTEN6, ADC_ADINTEN7,
  ADC_ADGINTEN
}
 

* ADC type interrupt enum

More...
enum  ADC_DATA_STATUS
 

ADC Data status.

More...

Functions

void ADC_Init (LPC_ADC_TypeDef *ADCx, uint32_t ConvFreq)
 Initial for ADC

  • Set bit PCADC
  • Set clock for ADC
  • Set Clock Frequency.

void ADC_DeInit (LPC_ADC_TypeDef *ADCx)
 Close ADC.
void ADC_BurstCmd (LPC_ADC_TypeDef *ADCx, FunctionalState NewState)
 ADC Burst mode setting.
void ADC_PowerdownCmd (LPC_ADC_TypeDef *ADCx, FunctionalState NewState)
 Set AD conversion in power mode.
void ADC_StartCmd (LPC_ADC_TypeDef *ADCx, uint8_t start_mode)
 Set start mode for ADC.
void ADC_EdgeStartConfig (LPC_ADC_TypeDef *ADCx, uint8_t EdgeOption)
 Set Edge start configuration.
void ADC_IntConfig (LPC_ADC_TypeDef *ADCx, ADC_TYPE_INT_OPT IntType, FunctionalState NewState)
 ADC interrupt configuration.
void ADC_ChannelCmd (LPC_ADC_TypeDef *ADCx, uint8_t Channel, FunctionalState NewState)
 Enable/Disable ADC channel number.
uint16_t ADC_ChannelGetData (LPC_ADC_TypeDef *ADCx, uint8_t channel)
 Get ADC result.
FlagStatus ADC_ChannelGetStatus (LPC_ADC_TypeDef *ADCx, uint8_t channel, uint32_t StatusType)
 Get ADC Chanel status from ADC data register.
uint16_t ADC_GlobalGetData (LPC_ADC_TypeDef *ADCx, uint8_t channel)
 Get ADC Data from AD Global register.
FlagStatus ADC_GlobalGetStatus (LPC_ADC_TypeDef *ADCx, uint32_t StatusType)
 Get ADC Chanel status from AD global data register.

Detailed Description

: Contains all macro definitions and function prototypes support for ADC firmware library on LPC17xx

Version:
: 1.0
Date:
: 3. April. 2009
Author:
: NgaDinh

Software that is described herein is for illustrative purposes only which provides customers with programming information regarding the products. This software is supplied "AS IS" without any warranties. NXP Semiconductors assumes no responsibility or liability for the use of the software, conveys no license or title under any patent, copyright, or mask work right to the product. NXP Semiconductors reserves the right to make changes in the software without notification. NXP Semiconductors also make no representation or warranty that such application will be suitable for the specified use without further testing or modification.

Definition in file lpc17xx_adc.h.