MHVLib  20111011
An efficiency oriented runtime library for AVR microcontrollers
MHV_ADC Class Reference

#include <MHV_ADC.h>

List of all members.

Public Member Functions

 MHV_ADC (MHV_EVENT_ADC *adcs, uint8_t adcCount)
void adc ()
void registerListener (uint8_t channel, MHV_ADCListener *listener)
void deregisterListener (uint8_t channel)
void enable ()
void disable ()
uint16_t busyRead (uint8_t channel, uint8_t reference)
void asyncRead (uint8_t channel, uint8_t reference)
void setPrescaler (MHV_AD_PRESCALER prescaler)
void handleEvents ()

Protected Attributes

uint16_t _adcValue
int8_t _adcChannel
MHV_EVENT_ADC_adcs
uint8_t _adcCount

Detailed Description

Definition at line 57 of file MHV_ADC.h.


Constructor & Destructor Documentation

MHV_ADC::MHV_ADC ( MHV_EVENT_ADC adcs,
uint8_t  adcCount 
)

An event manager for ADC events

Parameters:
adcsADC event handles
adcCountThe number of ADC events we can handle (must match adcs)

Definition at line 35 of file MHV_ADC.cpp.


Member Function Documentation

void MHV_ADC::adc ( )

Interrupt handler to read the ADC

Definition at line 47 of file MHV_ADC.cpp.

void MHV_ADC::asyncRead ( uint8_t  channel,
uint8_t  reference 
)

Trigger an ADC channel event

Parameters:
channelthe channel to read
referencethe voltage reference to use

Definition at line 107 of file MHV_ADC.cpp.

uint16_t MHV_ADC::busyRead ( uint8_t  channel,
uint8_t  reference 
)

Read an ADC channel

Parameters:
channelthe channel to read
referencethe voltage reference to use

Definition at line 87 of file MHV_ADC.cpp.

void MHV_ADC::deregisterListener ( uint8_t  channel)

Deregister interest for an ADC channel

Parameters:
channelthe ADC channel

Definition at line 73 of file MHV_ADC.cpp.

void MHV_ADC::disable ( )
void MHV_ADC::enable ( )
void MHV_ADC::handleEvents ( )

Call from the main loop to handle any events

Definition at line 132 of file MHV_ADC.cpp.

void MHV_ADC::registerListener ( uint8_t  channel,
MHV_ADCListener listener 
)

Register interest for an ADC channel

Parameters:
channelthe ADC channel
listeneran MHV_ADCListener to notify when an ADC reading has been completed

Definition at line 59 of file MHV_ADC.cpp.

void MHV_ADC::setPrescaler ( MHV_AD_PRESCALER  prescaler)

Set the ADC clock prescaler

Parameters:
prescalerthe prescaler to use

Definition at line 124 of file MHV_ADC.cpp.


Member Data Documentation

int8_t MHV_ADC::_adcChannel [protected]

Definition at line 60 of file MHV_ADC.h.

uint8_t MHV_ADC::_adcCount [protected]

Definition at line 62 of file MHV_ADC.h.

Definition at line 61 of file MHV_ADC.h.

uint16_t MHV_ADC::_adcValue [protected]

Definition at line 59 of file MHV_ADC.h.


The documentation for this class was generated from the following files: