#include <lpc21xx.h>
#include <types.h>
#include "adc.h"
#include <stdlib.h>
Defines | |
#define | ADCCH0 22 |
ADC0 value for PINSEL. | |
#define | ADCCH1 24 |
ADC1 value for PINSEL. | |
#define | ADCCH2 26 |
ADC2 value for PINSEL. | |
#define | ADCCH3 28 |
ADC3 value for PINSEL. | |
Functions | |
void | adc_isr (void) |
ADC ISR routine. | |
void | init_adc (unsigned rx_isr_vect) |
Inicializes ADC service for all ADC (4) channels and installs ISR routine to VIC. |
#define ADCCH0 22 |
ADC0 value for PINSEL.
#define ADCCH1 24 |
ADC1 value for PINSEL.
#define ADCCH2 26 |
ADC2 value for PINSEL.
#define ADCCH3 28 |
ADC3 value for PINSEL.
void adc_isr | ( | void | ) |
ADC ISR routine.
This routine reads selected ADC value and multiplies it by ADC_MUL and adds ADC_OFFSET to calculate the volage (3.25mV/div). After this reading the next ADC channel is set up for measuring.
void init_adc | ( | unsigned | rx_isr_vect | ) |
Inicializes ADC service for all ADC (4) channels and installs ISR routine to VIC.
inicializes ADC lines and starts converion (use ISR)
Automaticly starts the conversion of first channel on given conversion frequency.