simavr ADC allows external code to feed real voltages to the simulator, and the simulator uses it's 'real' reference voltage to do the right thing and return the 'proper' 10 bits ADC value to the AVR firmware.
More...
|
enum | {
ADC_IRQ_ADC0 = 0,
ADC_IRQ_ADC1,
ADC_IRQ_ADC2,
ADC_IRQ_ADC3,
ADC_IRQ_ADC4,
ADC_IRQ_ADC5,
ADC_IRQ_ADC6,
ADC_IRQ_ADC7,
ADC_IRQ_ADC8,
ADC_IRQ_ADC9,
ADC_IRQ_ADC10,
ADC_IRQ_ADC11,
ADC_IRQ_ADC12,
ADC_IRQ_ADC13,
ADC_IRQ_ADC14,
ADC_IRQ_ADC15,
ADC_IRQ_TEMP,
ADC_IRQ_IN_TRIGGER,
ADC_IRQ_OUT_TRIGGER,
ADC_IRQ_COUNT
} |
|
enum | {
ADC_MUX_NONE = 0,
ADC_MUX_NOISE,
ADC_MUX_SINGLE,
ADC_MUX_DIFF,
ADC_MUX_TEMP,
ADC_MUX_REF,
ADC_MUX_VCC4
} |
| Definition of a ADC mux mode. More...
|
|
enum | {
ADC_VREF_AREF = 0,
ADC_VREF_VCC,
ADC_VREF_AVCC,
ADC_VREF_V110 = 1100,
ADC_VREF_V256 = 2560
} |
|
enum | avr_adts_type {
avr_adts_none = 0,
avr_adts_free_running,
avr_adts_analog_comparator_0,
avr_adts_analog_comparator_1,
avr_adts_analog_comparator_2,
avr_adts_analog_comparator_3,
avr_adts_external_interrupt_0,
avr_adts_timer_0_compare_match_a,
avr_adts_timer_0_compare_match_b,
avr_adts_timer_0_overflow,
avr_adts_timer_1_compare_match_b,
avr_adts_timer_1_overflow,
avr_adts_timer_1_capture_event,
avr_adts_pin_change_interrupt,
avr_adts_psc_module_0_sync_signal,
avr_adts_psc_module_1_sync_signal,
avr_adts_psc_module_2_sync_signal
} |
| ADC trigger sources. More...
|
|
simavr ADC allows external code to feed real voltages to the simulator, and the simulator uses it's 'real' reference voltage to do the right thing and return the 'proper' 10 bits ADC value to the AVR firmware.
To send values to the ADC, register your code to wait for the ADC_IRQ_OUT_TRIGGER irq, and at that point send any of the ADC_IRQ_ADC* with Millivolts as value.
External trigger is not done yet.
#define AVR_ADC_DIFF |
( |
|
_a, |
|
|
|
_b, |
|
|
|
_g |
|
) |
| |
Value:{ \
.src = (_a), \
.diff = (_b), \
.gain = (_g), \
}
Normal ADC pin reading
Definition: avr_adc.h:66
#define AVR_ADC_REF |
( |
|
_t | ) |
|
Value:{ \
.src = (_t), \
}
internal temp sensor
Definition: avr_adc.h:68
#define AVR_ADC_SINGLE |
( |
|
_chan | ) |
|
Value:{ \
.src = (_chan), \
}
Nothing. return something random
Definition: avr_adc.h:65
Value:{ \
}
differential channels (src-diff)
Definition: avr_adc.h:67
Value:{ \
}
reference voltage (in src * 100)
Definition: avr_adc.h:69
Get the internal IRQ corresponding to the INT.
Enumerator |
---|
ADC_IRQ_ADC0 |
input IRQ values. Values are /always/ volts * 1000 (millivolts)
|
ADC_IRQ_ADC1 |
|
ADC_IRQ_ADC2 |
|
ADC_IRQ_ADC3 |
|
ADC_IRQ_ADC4 |
|
ADC_IRQ_ADC5 |
|
ADC_IRQ_ADC6 |
|
ADC_IRQ_ADC7 |
|
ADC_IRQ_ADC8 |
|
ADC_IRQ_ADC9 |
|
ADC_IRQ_ADC10 |
|
ADC_IRQ_ADC11 |
|
ADC_IRQ_ADC12 |
|
ADC_IRQ_ADC13 |
|
ADC_IRQ_ADC14 |
|
ADC_IRQ_ADC15 |
|
ADC_IRQ_TEMP |
|
ADC_IRQ_IN_TRIGGER |
|
ADC_IRQ_OUT_TRIGGER |
|
ADC_IRQ_COUNT |
sends a avr_adc_mux_t
|
Definition of a ADC mux mode.
Enumerator |
---|
ADC_MUX_NONE |
|
ADC_MUX_NOISE |
Nothing. return 0
|
ADC_MUX_SINGLE |
Nothing. return something random
|
ADC_MUX_DIFF |
Normal ADC pin reading
|
ADC_MUX_TEMP |
differential channels (src-diff)
|
ADC_MUX_REF |
internal temp sensor
|
ADC_MUX_VCC4 |
reference voltage (in src * 100)
|
Enumerator |
---|
ADC_VREF_AREF |
|
ADC_VREF_VCC |
default mode
|
ADC_VREF_AVCC |
|
ADC_VREF_V110 |
|
ADC_VREF_V256 |
|
ADC trigger sources.
Enumerator |
---|
avr_adts_none |
|
avr_adts_free_running |
|
avr_adts_analog_comparator_0 |
|
avr_adts_analog_comparator_1 |
|
avr_adts_analog_comparator_2 |
|
avr_adts_analog_comparator_3 |
|
avr_adts_external_interrupt_0 |
|
avr_adts_timer_0_compare_match_a |
|
avr_adts_timer_0_compare_match_b |
|
avr_adts_timer_0_overflow |
|
avr_adts_timer_1_compare_match_b |
|
avr_adts_timer_1_overflow |
|
avr_adts_timer_1_capture_event |
|
avr_adts_pin_change_interrupt |
|
avr_adts_psc_module_0_sync_signal |
|
avr_adts_psc_module_1_sync_signal |
|
avr_adts_psc_module_2_sync_signal |
|