* ADC must be initialised prior to calls to adc_display() (it means that adc_on()
* must be called before using this function.
* adc_num is an ADC channel number (integer between 0 and 7)
- * use LPC_ADC_NUM(x) for channel selection.
+ * use LPC_ADC(x) for channel selection.
* returns ADC convertion value or negative value on error.
*/
int adc_display(int adc_num, int uart_num)
/* ADC Setup */
adc_on(NULL);
- adc_prepare_conversion_on_event((LPC_ADC_CHANNEL(9) | LPC_ADC_CHANNEL(10)),
+ adc_prepare_conversion_on_event((ADC_MCH(9) | ADC_MCH(10)),
LPC_ADC_START_CONV_SOFT, LPC_ADC_SEQA, 0, 0);
while (1) {
/* ADC Test */
adc_trigger_sequence_conversion(LPC_ADC_SEQA);
msleep(10);
- adc_display(LPC_ADC_NUM(9), UART0);
- adc_display(LPC_ADC_NUM(10), UART0);
+ adc_display(LPC_ADC(9), UART0);
+ adc_display(LPC_ADC(10), UART0);
}
return 0;
}
uint16_t red = 0, green = 0, blue = 0;
/* Get ADC values */
- adc_get_value(&red, LPC_ADC_NUM(2));
- adc_get_value(&green, LPC_ADC_NUM(9));
- adc_get_value(&blue, LPC_ADC_NUM(10));
+ adc_get_value(&red, LPC_ADC(2));
+ adc_get_value(&green, LPC_ADC(9));
+ adc_get_value(&blue, LPC_ADC(10));
/* Set one pixel */
ws2812_set_pixel(pixel++, ((red >> 4) & 0xFF), ((green >> 4) & 0xFF), ((blue >> 4) & 0xFF));
msleep(5);
/* ADC for potentiometer color settings */
adc_on(NULL);
- adc_start_burst_conversion(LPC_ADC_CHANNEL(2) | LPC_ADC_CHANNEL(9) | LPC_ADC_CHANNEL(10), LPC_ADC_SEQB);
+ adc_start_burst_conversion(ADC_MCH(2) | ADC_MCH(9) | ADC_MCH(10), LPC_ADC_SEQB);
/* Led strip configuration */
ws2812_config(&ws2812_data_out_pin);