Classes | |
struct | ConversionCompleteInterrupt |
Typedefs | |
typedef _ADC | Result |
Enumerations | |
enum | Reference { AREF = 0x00, AVCC = 0x40, InternalRef = 0x80 | 0x40 } |
enum | Adjustment { AlignRight = 0x00, AlignLeft = 0x20 } |
enum | InterruptEnableFlag { InterruptEnable = 0x8, InterruptDisable = 0x00 } |
enum | EnableFlag { ADCEnable = 0x80, ADCDisable = 0x00 } |
enum | ConversionStart { StartNow = 0x40, StartLater = 0x00 } |
enum | FreeRunning { FreeRunMode = 0x20, FreeRunStopped = 0x00 } |
enum | Prescaler { Div2 = 0x01, Div4 = 0x02, Div8 = 0x03, Div16 = 0x04, Div32 = 0x05, Div64 = 0x06, Div128 = 0x07 } |
enum | AnalogChannel { ADC0 = 0x00, ADC1 = 0x01, ADC2 = 0x02, ADC3 = 0x03, ADC4 = 0x04, ADC5 = 0x05, ADC6 = 0x06, ADC7 = 0x07, Vbandgap = 0x0E, GND = 0x0F } |
enum | AutoTriggerSource { FreeRunningMode = 0x00, AnalogComparator = 0x01, ExternalInterruptRequest0 = 0x02, Counter0CompareMatch = 0x03, Counter0Overflow = 0x04, Counter1CompareMatchB = 0x05, Counter1Overflow = 0x06, Counter1CaptureEvent = 0x07 } |
Functions | |
bool | IsConverting () |
void | WaitWhileConverting () |
void | EnsureChangeSafety () |
void | SelectionSetUp (Reference reference, Adjustment adjustment, AnalogChannel channel) |
void | ControlSetUp (EnableFlag enableFlag, ConversionStart conversionStart, FreeRunning freeRunning, InterruptEnableFlag interruptEnableFlag, Prescaler prescaler) |
void | SetChannel (AnalogChannel channel) |
void | SelectPrescaler (Prescaler prescaler) |
void | Enable () |
void | Disable () |
bool | IsEnabled () |
void | StartConversion () |
void | EnableAutoTrigger () |
void | DisableAutoTrigger () |
bool | IsAutoTriggerEnabled () |
void | SetAutoTriggerSource (AutoTriggerSource source) |
void | EnableFreeRun () |
void | DisableFreeRun () |
bool | IsFreeRunEnabled () |
void | StartFreeRun () |
void | StopFreeRun () |
void | DigitalInputDisable (uint8_t pins) |
Disables the digital input buffers of the pins specified. | |
void | DigitalInputEnable (uint8_t pins) |
Enables the digital input buffers for the specified pins. | |
void | SetDigitalInput (uint8_t pins) |
Enables the digital input buffers for the specified pins, disables for others. |
typedef _ADC AVRCpp::AnalogToDigital::Result |
Definition at line 114 of file ADC.h.
00115 { 00116 AlignRight = 0x00, 00117 AlignLeft = _ADLAR 00118 00119 }; // enum Adjustment
FreeRunningMode | |
AnalogComparator | |
ExternalInterruptRequest0 | |
Counter0CompareMatch | |
Counter0Overflow | |
Counter1CompareMatchB | |
Counter1Overflow | |
Counter1CaptureEvent |
Definition at line 209 of file ADC.h.
00210 { 00211 FreeRunningMode = 0x00, 00212 AnalogComparator = 0x01, 00213 ExternalInterruptRequest0 = 0x02, 00214 Counter0CompareMatch = 0x03, 00215 Counter0Overflow = 0x04, 00216 Counter1CompareMatchB = 0x05, 00217 Counter1Overflow = 0x06, 00218 Counter1CaptureEvent = 0x07 00219 00220 }; // enum AutoTriggerSource
Definition at line 135 of file ADC.h.
00136 { 00137 StartNow = _ADSC, 00138 StartLater = 0x00 00139 00140 }; // enum ConversionStart
Definition at line 128 of file ADC.h.
00129 { 00130 ADCEnable = _ADEN, 00131 ADCDisable = 0x00 00132 00133 }; // enum EnableFlag
Definition at line 142 of file ADC.h.
00143 { 00144 FreeRunMode = 0x20, 00145 FreeRunStopped = 0x00 00146 00147 }; // enum FreeRunning
Definition at line 121 of file ADC.h.
00122 { 00123 InterruptEnable = _ADIE, 00124 InterruptDisable = 0x00 00125 00126 }; // enum InterruptEnableFlag
void AVRCpp::AnalogToDigital::ControlSetUp | ( | EnableFlag | enableFlag, | |
ConversionStart | conversionStart, | |||
FreeRunning | freeRunning, | |||
InterruptEnableFlag | interruptEnableFlag, | |||
Prescaler | prescaler | |||
) | [inline] |
void AVRCpp::AnalogToDigital::DigitalInputDisable | ( | uint8_t | pins | ) | [inline] |
Disables the digital input buffers of the pins specified.
It is used to reduce power consumption in the digital input buffer because you do not need digital input buffers when you use these pins as an analog input port. Note that ADC7 and ADC6 do not have digital inputs, so for example the instruction DigitalInputDisable(ADC7 | ADC6 | ADC5) only switches off the fifth pin's buffer.
Definition at line 347 of file ADC.h.
void AVRCpp::AnalogToDigital::DigitalInputEnable | ( | uint8_t | pins | ) | [inline] |
void AVRCpp::AnalogToDigital::Disable | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::DisableAutoTrigger | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::DisableFreeRun | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::Enable | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::EnableAutoTrigger | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::EnableFreeRun | ( | ) | [inline] |
Definition at line 320 of file ADC.h.
00320 { EnableAutoTrigger(); SetAutoTriggerSource(FreeRunningMode); }
void AVRCpp::AnalogToDigital::EnsureChangeSafety | ( | ) | [inline] |
Definition at line 229 of file ADC.h.
00230 { 00231 if (IsConverting() ) 00232 Assembler::NOP(); 00233 00234 } // EnsureChangeSafety
bool AVRCpp::AnalogToDigital::IsAutoTriggerEnabled | ( | ) | [inline] |
bool AVRCpp::AnalogToDigital::IsConverting | ( | ) | [inline] |
bool AVRCpp::AnalogToDigital::IsEnabled | ( | ) | [inline] |
bool AVRCpp::AnalogToDigital::IsFreeRunEnabled | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::SelectionSetUp | ( | Reference | reference, | |
Adjustment | adjustment, | |||
AnalogChannel | channel | |||
) | [inline] |
Definition at line 237 of file ADC.h.
00241 { 00242 EnsureChangeSafety(); 00243 ADMUX = reference | adjustment | channel; 00244 00245 } // SelectionSetUp
void AVRCpp::AnalogToDigital::SelectPrescaler | ( | Prescaler | prescaler | ) | [inline] |
void AVRCpp::AnalogToDigital::SetAutoTriggerSource | ( | AutoTriggerSource | source | ) | [inline] |
void AVRCpp::AnalogToDigital::SetChannel | ( | AnalogChannel | channel | ) | [inline] |
void AVRCpp::AnalogToDigital::SetDigitalInput | ( | uint8_t | pins | ) | [inline] |
void AVRCpp::AnalogToDigital::StartConversion | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::StartFreeRun | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::StopFreeRun | ( | ) | [inline] |
void AVRCpp::AnalogToDigital::WaitWhileConverting | ( | ) | [inline] |
MTÜ TTÜ Robotiklubi |