|
3-phase PV router
|
Native tests for adc_chain.h: the six conversions, the reference and the ADMUX pipeline. More...

Go to the source code of this file.
Enumerations | |
| enum class | Channel |
Functions | |
| static Channel | channelOfAdmux (const uint8_t admux) |
| The channel an ADMUX value selects, from its analog input. | |
| int | main (int, char **) |
| void | setUp (void) |
| void | tearDown (void) |
| void | test_admux_of_is_reference_adlar_and_pin (void) |
| void | test_admux_written_after_selects_the_channel_after_next (void) |
| void | test_after_next_of_every_position (void) |
| void | test_channel_converted_by_round (void) |
| void | test_channel_table_matches_the_former_literals (void) |
| void | test_order_of_the_chain (void) |
| void | test_pins (void) |
| void | test_pipeline_order (void) |
| void | test_reference_per_board (void) |
Variables | |
| constexpr uint8_t | ADLAR_BIT { 1U << 5 } |
| constexpr uint8_t | AVCC { 1U << 6 } |
| constexpr PcbVersion | boards [] { PcbVersion::OLD, PcbVersion::NEW } |
| constexpr Channel | chain [] { Channel::V1, Channel::I1, Channel::V2, Channel::I2, Channel::V3, Channel::I3 } |
| constexpr uint8_t | INTERNAL_1V1 { (1U << 7) | (1U << 6) } |
| constexpr uint8_t | MUX_MASK { 0x0F } |
| constexpr uint8_t | REF_MASK { (1U << 7) | (1U << 6) } |
Native tests for adc_chain.h: the six conversions, the reference and the ADMUX pipeline.
The ADC converts six channels in a fixed chain V1, I1, V2, I2, V3, I3. It runs free: when the ISR of a finished conversion runs, the next conversion has already started with the previous ADMUX, so the ADMUX written now applies to the conversion after next. The pipeline test plays this out and checks that the channel really converted is the one the ISR believes it handles, on each board. The last test pins the values of the table that processing.cpp wrote by hand before it was built from adc_chain.h.
Definition in file test_main.cpp.
|
strong |
The six conversions, in the order of the chain: a V then an I, for each phase
Definition at line 34 of file adc_chain.h.
|
static |
The channel an ADMUX value selects, from its analog input.
Definition at line 33 of file test_main.cpp.


| int main | ( | int | , |
| char ** | ) |
| void setUp | ( | void | ) |
Definition at line 18 of file test_main.cpp.
| void tearDown | ( | void | ) |
Definition at line 19 of file test_main.cpp.
| void test_admux_of_is_reference_adlar_and_pin | ( | void | ) |
Definition at line 80 of file test_main.cpp.


| void test_admux_written_after_selects_the_channel_after_next | ( | void | ) |
Definition at line 106 of file test_main.cpp.


| void test_after_next_of_every_position | ( | void | ) |
Definition at line 93 of file test_main.cpp.


| void test_channel_converted_by_round | ( | void | ) |
Definition at line 117 of file test_main.cpp.


| void test_channel_table_matches_the_former_literals | ( | void | ) |
< the pin the ADMUX of this entry selects
Definition at line 155 of file test_main.cpp.


| void test_order_of_the_chain | ( | void | ) |
| void test_pins | ( | void | ) |
Definition at line 59 of file test_main.cpp.


| void test_pipeline_order | ( | void | ) |
Definition at line 126 of file test_main.cpp.


| void test_reference_per_board | ( | void | ) |
Definition at line 72 of file test_main.cpp.


|
inlineconstexpr |
left-adjusted result
Definition at line 30 of file test_main.cpp.
|
inlineconstexpr |
REFS0 alone: AVcc
Definition at line 28 of file test_main.cpp.
|
inlineconstexpr |
Definition at line 23 of file test_main.cpp.
|
inlineconstexpr |
Definition at line 24 of file test_main.cpp.
|
inlineconstexpr |
REFS1 and REFS0: internal 1.1 V
Definition at line 29 of file test_main.cpp.
|
inlineconstexpr |
MUX3..0: the analog input
Definition at line 26 of file test_main.cpp.
|
inlineconstexpr |
REFS1, REFS0
Definition at line 27 of file test_main.cpp.