Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
5bf8544
refactor get_state to EdgePiADC
flavius-t Nov 8, 2022
6192bbf
refactor ADCModes
flavius-t Nov 8, 2022
266bf7a
todos
flavius-t Nov 9, 2022
90c4da3
Merge branch 'dev' into adc-get-state
flavius-t Nov 9, 2022
54fa0e6
add get_register_map
flavius-t Nov 9, 2022
025ba39
refactor get_register_map
flavius-t Nov 9, 2022
299b402
docstring upate
flavius-t Nov 9, 2022
2c5d614
refactor get_register_map
flavius-t Nov 9, 2022
cd3fe6a
use get_register_map for internal register reads
flavius-t Nov 9, 2022
13002ba
refactor ADCState
flavius-t Nov 10, 2022
142f322
use new ADCState for getting state internally
flavius-t Nov 10, 2022
d2b5fba
refactor logging
flavius-t Nov 10, 2022
0e57ba3
add get mux states
flavius-t Nov 10, 2022
0117abf
refactor state query constants to module
flavius-t Nov 10, 2022
c30ca30
add idac_mux queries
flavius-t Nov 10, 2022
f38c4b9
idac mag querying, fixes
flavius-t Nov 10, 2022
cbb3d23
add refmux querying
flavius-t Nov 10, 2022
4d6c87d
move querying method to state query module
flavius-t Nov 10, 2022
6a84d0c
update documentation
flavius-t Nov 10, 2022
6d2e7ff
phrasing change
flavius-t Nov 10, 2022
7205c46
fix class var use
flavius-t Nov 10, 2022
55eea09
fix non-subscriptable pylint error
flavius-t Nov 10, 2022
95101f7
tests for ADCState, fix
flavius-t Nov 10, 2022
8a50104
fix and test status_byte querying
flavius-t Nov 10, 2022
c5626e7
test adc1 mux querying
flavius-t Nov 10, 2022
da125d6
test adc2 mux querying
flavius-t Nov 10, 2022
93a499c
fix remaining queries
flavius-t Nov 10, 2022
ec9a93d
fix bug
flavius-t Nov 11, 2022
33c71b0
remove outdated todos
flavius-t Nov 11, 2022
1eef8c3
test filter mode queries
flavius-t Nov 11, 2022
14d0f08
review changes
flavius-t Nov 11, 2022
531f5ad
test rtd_on state, fix rtd state bugs
flavius-t Nov 14, 2022
790a1bb
refactor rtd_on state test, add test cases
flavius-t Nov 14, 2022
c5c4219
get_state integration tests
flavius-t Nov 14, 2022
9412846
crc get_state integeration tests
flavius-t Nov 14, 2022
ceb7d92
unit test adc1 data rate get state
flavius-t Nov 15, 2022
1dfe53d
unit test adc2 data rate get state
flavius-t Nov 15, 2022
947fd2b
conv mode get state integration tests
flavius-t Nov 15, 2022
8601bb9
integration tests for data rate state
flavius-t Nov 15, 2022
668d407
filter mode state integration tests
flavius-t Nov 15, 2022
5777ada
integration tests for rtd mode get state
flavius-t Nov 15, 2022
a3eece5
add get_state with caching integration tests
flavius-t Nov 15, 2022
a7c64aa
add get_state check to rtd_mode int test
flavius-t Nov 15, 2022
044ea62
fixing bugs and unit tests
flavius-t Nov 15, 2022
c4ae040
fix unit tests
flavius-t Nov 15, 2022
6203674
remove outdated comment
flavius-t Nov 15, 2022
0abcf8f
fix lint errors
flavius-t Nov 16, 2022
d36e264
import error fix
flavius-t Nov 16, 2022
1c48c8b
Merge branch 'dev' into adc-get-state
flavius-t Nov 16, 2022
84aa277
pr changes
flavius-t Nov 17, 2022
ff69192
pr fix
flavius-t Nov 17, 2022
e204978
Merge branch 'dev' into adc-get-state
flavius-t Nov 17, 2022
36812a1
rename params to adc_property
flavius-t Nov 17, 2022
6a2aad4
docstring update
flavius-t Nov 17, 2022
93ebc33
fix integration test errors
flavius-t Nov 17, 2022
483cdc1
integration test error fixes
flavius-t Nov 17, 2022
db5d576
state caching bug fixes
flavius-t Nov 17, 2022
02bef30
bug fix
flavius-t Nov 17, 2022
19afcba
combined cache/cacheless state tests
flavius-t Nov 17, 2022
07d1e00
lint fixes
flavius-t Nov 17, 2022
e960acb
linting
flavius-t Nov 17, 2022
dfc2460
extend tests for combined cached/cacheless state
flavius-t Nov 17, 2022
740cad0
disable too many lines lint error
flavius-t Nov 17, 2022
b48f400
Merge branch 'dev' into adc-get-state
flavius-t Nov 18, 2022
9da6ade
pr changes
flavius-t Nov 18, 2022
33f101b
pr review changes
flavius-t Nov 18, 2022
9b7666e
linting
flavius-t Nov 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[pytest]
; faulthandler_timeout=5
log_level=DEBUG
log_format=%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s
log_level=ERROR
log_format=%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s
# **********************
# These tests rely on python periphery which is not available on Windows, so this causes
# Pytest discovery error. Uncomment below line when using Windows, in order to hide integration and
# hardware tests from Pytest and prevent Pytest discovery errors.
# **********************
; addopts= --ignore=./src/test_edgepi/integration_tests --ignore=./src/test_edgepi/hardware_tests
24 changes: 2 additions & 22 deletions src/edgepi/adc/adc_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,25 +247,6 @@ class DiffMode(Enum):
DIFF_OFF = DifferentialPair(ADCChannel.FLOAT, ADCChannel.AINCOM)


@dataclass
class ADCMode:
"""Stores information about an ADC functional mode"""

addx: int
mask: int


class ADCModes(Enum):
"""Address and mask values for ADC functional modes"""

CONV = ADCMode(ADCReg.REG_MODE0.value, BitMask.BIT6.value)
CHECK = ADCMode(ADCReg.REG_INTERFACE.value, ADCMasks.CHECK_BITS.value)
STATUS = ADCMode(ADCReg.REG_INTERFACE.value, BitMask.BIT2.value)
DATA_RATE_1 = ADCMode(ADCReg.REG_MODE2.value, BitMask.LOW_NIBBLE.value)
DATA_RATE_2 = ADCMode(ADCReg.REG_ADC2CFG.value, ADCMasks.ADC2_DR_BITS.value)
FILTER = ADCMode(ADCReg.REG_MODE1.value, ADCMasks.FILTER_BITS.value)


class IDACMUX(Enum):
"""Settings for ADC IDACMUX register (output multiplexer mapping)"""

Expand Down Expand Up @@ -343,12 +324,11 @@ class RTDModes(Enum):
"adc_1_analog_in": ADCChannel.AIN5,
"adc_1_mux_n": ADCChannel.AIN6,
"idac_1_mux": IDACMUX.IDAC1_AIN8,
"idac_2_mux": IDACMUX.IDAC1_AIN9,
"idac_2_mux": IDACMUX.IDAC2_AIN9,
"idac_1_mag": IDACMAG.IDAC1_500,
"idac_2_mag": IDACMAG.IDAC2_500,
"pos_ref_inp": REFMUX.POS_REF_EXT_AIN4,
"neg_ref_inp": REFMUX.NEG_REF_INT_VAVSS,
"rtd_mode_update": True,
}
RTD_OFF = {
"adc_1_analog_in": ADCChannel.FLOAT,
Expand All @@ -359,12 +339,12 @@ class RTDModes(Enum):
"idac_2_mag": IDACMAG.IDAC2_OFF,
"pos_ref_inp": REFMUX.POS_REF_INT_2P5,
"neg_ref_inp": REFMUX.NEG_REF_INT_2P5,
"rtd_mode_update": True,
}


class AllowedChannels(Enum):
"""Available channels for reading depend on whether RTD is enabled or not"""

RTD_ON = [
ADCChannel.AIN0,
ADCChannel.AIN1,
Expand Down
Loading