EV Logger
A MSP430 based datalogger for an electric vehicle
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
adc.c File Reference

Handles configuration and initialisation of the analogue to digital converter unit, plus starting conversions and post-handling the conversion results. More...

#include <inttypes.h>
#include "adc.h"
#include "system.h"

Functions

void adc_init (volatile SampleBuffer *sb)
 Set up the ADC clock and configure resolution, then enable the ADC unit. More...
 
void adc_convert (void)
 Enable DMA on channel 0 which will move data to the sample buffer after the ADC conversion run has completed, then begin the conversion run.
 

Detailed Description

Handles configuration and initialisation of the analogue to digital converter unit, plus starting conversions and post-handling the conversion results.

We use DMA channel 0 to move results from the ADC conversion memory into a SampleBuffer once the conversion has completed, such that the CPU need only request the beginning of a conversion run and some time later, the results will appear in the SampleBuffer that the CPU specified.

Author
Jon Sowman, University of Southampton j.sow.nosp@m.man@.nosp@m.soton.nosp@m..ac..nosp@m.uk