8. lpc17xx_adc Module¶
ADC client library functions. Find implementation details in LPC17xx CMSIS-Compliant Standard Peripheral Firmware Driver Library documentation.
- robovero.lpc17xx_adc.ADC_ADCOFFS(n)¶
Offset trim bits for ADC operation.
- robovero.lpc17xx_adc.ADC_BurstCmd(ADCx, NewState)¶
ADC Burst mode setting.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC NewState: 0:Reset Burst mode, 1:Set Burst mode
- class robovero.lpc17xx_adc.ADC_CHANNEL_SELECTION¶
Channel Selection.
- ADC_CHANNEL_0 = 0¶
- ADC_CHANNEL_1 = 1¶
- ADC_CHANNEL_2 = 2¶
- ADC_CHANNEL_3 = 3¶
- ADC_CHANNEL_4 = 4¶
- ADC_CHANNEL_5 = 5¶
- ADC_CHANNEL_6 = 6¶
- ADC_CHANNEL_7 = 7¶
- robovero.lpc17xx_adc.ADC_CR_CH_SEL(n)¶
Selects ADC pin to be sampled and converted.
Args:
- n(int): ADC pin number, between 0 to 7
- robovero.lpc17xx_adc.ADC_CR_CLKDIV(n)¶
The APB clock (PCLK) is divided by (this value plus one) to produce the clock for the A/D.
Args:
- n(int): ADC pin number, between 0 to 7
- robovero.lpc17xx_adc.ADC_CR_START_MODE_SEL(SEL)¶
Select Start Mode.
- robovero.lpc17xx_adc.ADC_ChannelCmd(ADCx, Channel, NewState)¶
Enable/Disable ADC channel number.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC Channel: channel number NewState: Enable or Disable
- robovero.lpc17xx_adc.ADC_ChannelGetData(ADCx, channel)¶
Get ADC result.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC channel: channel number, should be 0...7 return: Data conversion
- robovero.lpc17xx_adc.ADC_ChannelGetStatus(ADCx, channel, StatusType)¶
Get ADC Channel status from ADC data register.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC channel: channel number, should be 0..7 StatusType: 0:Burst status, 1:Done status return: SET / RESET
- robovero.lpc17xx_adc.ADC_DR_RESULT(n)¶
When DONE is 1, this field contains result value of ADC conversion.
- robovero.lpc17xx_adc.ADC_DeInit(ADCx)¶
Close ADC.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC
- robovero.lpc17xx_adc.ADC_EdgeStartConfig(ADCx, EdgeOption)¶
Set Edge start configuration.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC EdgeOption: ADC_START_ON_RISING and ADC_START_ON_FALLING
- robovero.lpc17xx_adc.ADC_GDR_CH(n)¶
These bits contain the channel from which the LS bits were converted.
- robovero.lpc17xx_adc.ADC_GDR_RESULT(n)¶
When DONE is 1, this field contains result value of ADC conversion.
- robovero.lpc17xx_adc.ADC_GlobalGetData(ADCx)¶
Get ADC Data from AD Global register.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC return: Result of conversion
- robovero.lpc17xx_adc.ADC_GlobalGetStatus(ADCx, StatusType)¶
Get ADC Chanel status from AD global data register.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC StatusType: 0:Burst status, 1:Done status return: SET / RESET
- robovero.lpc17xx_adc.ADC_INTEN_CH(n)¶
These bits allow control over which A/D channels generate interrupts for conversion completion.
- robovero.lpc17xx_adc.ADC_Init(ADCx, rate)¶
Initialize ADC.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC rate: ADC conversion rate, should be <=200KHz
- robovero.lpc17xx_adc.ADC_IntConfig(ADCx, IntType, NewState)¶
ADC interrupt configuration.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC IntType: one of interrupt types in ‘ADC_TYPE_INT_OPT’ class NewState: SET : enable ADC interrupt, RESET: disable ADC interrupt
- robovero.lpc17xx_adc.ADC_PowerdownCmd(ADCx, NewState)¶
Set AD conversion in power mode.
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC NewState: 1: AD converter is optional, 0: AD Converter is in power down mode
- class robovero.lpc17xx_adc.ADC_START_ON_EDGE_OPT¶
Type of edge when start conversion on the selected CAP/MAT signal.
- ADC_START_ON_FALLING = 1¶
- ADC_START_ON_RISING = 0¶
- class robovero.lpc17xx_adc.ADC_START_OPT¶
Type of start option.
- ADC_START_CONTINUOUS = 0¶
- ADC_START_NOW = 1¶
- ADC_START_ON_CAP01 = 3¶
- ADC_START_ON_EINT0 = 2¶
- ADC_START_ON_MAT01 = 4¶
- ADC_START_ON_MAT03 = 5¶
- ADC_START_ON_MAT10 = 6¶
- ADC_START_ON_MAT11 = 7¶
- robovero.lpc17xx_adc.ADC_STAT_CH_DONE_FLAG(n)¶
These bits mirror the DONE status flags that appear in the result register for each A/D channel.
- robovero.lpc17xx_adc.ADC_STAT_CH_OVERRUN_FLAG(n)¶
These bits mirror the OVERRRUN status flags that appear in the result register for each A/D channel
- robovero.lpc17xx_adc.ADC_StartCmd(ADCx, start_mode)¶
Set start mode for ADC
ADCx: pointer to LPC_ADC_TypeDef, should be: LPC_ADC start_mode: one of modes in ‘ADC_START_OPT’ class
- robovero.lpc17xx_adc.ADC_TRIM(n)¶
Written to boot code.