shepherd-core 2024.4.1__py3-none-any.whl → 2024.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. shepherd_core/__init__.py +3 -3
  2. shepherd_core/calibration_hw_def.py +9 -1
  3. shepherd_core/commons.py +2 -0
  4. shepherd_core/data_models/__init__.py +11 -0
  5. shepherd_core/data_models/base/__init__.py +4 -1
  6. shepherd_core/data_models/base/cal_measurement.py +18 -6
  7. shepherd_core/data_models/base/calibration.py +39 -15
  8. shepherd_core/data_models/base/content.py +10 -2
  9. shepherd_core/data_models/base/shepherd.py +21 -12
  10. shepherd_core/data_models/base/timezone.py +5 -0
  11. shepherd_core/data_models/base/wrapper.py +3 -3
  12. shepherd_core/data_models/content/__init__.py +5 -4
  13. shepherd_core/data_models/content/_external_fixtures.yaml +410 -0
  14. shepherd_core/data_models/content/energy_environment.py +7 -5
  15. shepherd_core/data_models/content/energy_environment_fixture.yaml +53 -0
  16. shepherd_core/data_models/content/firmware.py +12 -5
  17. shepherd_core/data_models/content/firmware_datatype.py +7 -0
  18. shepherd_core/data_models/content/virtual_harvester.py +24 -19
  19. shepherd_core/data_models/content/virtual_harvester_fixture.yaml +160 -0
  20. shepherd_core/data_models/content/virtual_source.py +22 -10
  21. shepherd_core/data_models/content/virtual_source_fixture.yaml +230 -0
  22. shepherd_core/data_models/experiment/__init__.py +5 -4
  23. shepherd_core/data_models/experiment/experiment.py +7 -6
  24. shepherd_core/data_models/experiment/observer_features.py +14 -7
  25. shepherd_core/data_models/experiment/target_config.py +11 -7
  26. shepherd_core/data_models/readme.md +88 -0
  27. shepherd_core/data_models/task/__init__.py +10 -3
  28. shepherd_core/data_models/task/emulation.py +10 -7
  29. shepherd_core/data_models/task/firmware_mod.py +4 -2
  30. shepherd_core/data_models/task/harvest.py +5 -4
  31. shepherd_core/data_models/task/observer_tasks.py +3 -1
  32. shepherd_core/data_models/task/programming.py +3 -1
  33. shepherd_core/data_models/task/testbed_tasks.py +3 -1
  34. shepherd_core/data_models/testbed/__init__.py +5 -2
  35. shepherd_core/data_models/testbed/cape.py +7 -5
  36. shepherd_core/data_models/testbed/cape_fixture.yaml +94 -0
  37. shepherd_core/data_models/testbed/gpio.py +10 -8
  38. shepherd_core/data_models/testbed/gpio_fixture.yaml +166 -0
  39. shepherd_core/data_models/testbed/mcu.py +9 -9
  40. shepherd_core/data_models/testbed/mcu_fixture.yaml +19 -0
  41. shepherd_core/data_models/testbed/observer.py +9 -4
  42. shepherd_core/data_models/testbed/observer_fixture.yaml +221 -0
  43. shepherd_core/data_models/testbed/target.py +4 -2
  44. shepherd_core/data_models/testbed/target_fixture.yaml +137 -0
  45. shepherd_core/data_models/testbed/testbed.py +5 -2
  46. shepherd_core/data_models/testbed/testbed_fixture.yaml +25 -0
  47. shepherd_core/decoder_waveform/__init__.py +2 -0
  48. shepherd_core/decoder_waveform/uart.py +43 -25
  49. shepherd_core/fw_tools/__init__.py +2 -0
  50. shepherd_core/fw_tools/converter.py +20 -9
  51. shepherd_core/fw_tools/converter_elf.py +3 -0
  52. shepherd_core/fw_tools/patcher.py +17 -5
  53. shepherd_core/fw_tools/validation.py +27 -6
  54. shepherd_core/inventory/__init__.py +15 -5
  55. shepherd_core/inventory/python.py +4 -0
  56. shepherd_core/inventory/system.py +6 -2
  57. shepherd_core/inventory/target.py +4 -0
  58. shepherd_core/logger.py +5 -0
  59. shepherd_core/reader.py +38 -23
  60. shepherd_core/testbed_client/__init__.py +2 -0
  61. shepherd_core/testbed_client/cache_path.py +2 -0
  62. shepherd_core/testbed_client/client.py +15 -8
  63. shepherd_core/testbed_client/fixtures.py +27 -11
  64. shepherd_core/testbed_client/user_model.py +8 -3
  65. shepherd_core/vsource/__init__.py +2 -0
  66. shepherd_core/vsource/virtual_converter_model.py +10 -3
  67. shepherd_core/vsource/virtual_harvester_model.py +7 -1
  68. shepherd_core/vsource/virtual_source_model.py +9 -5
  69. shepherd_core/writer.py +26 -21
  70. {shepherd_core-2024.4.1.dist-info → shepherd_core-2024.5.1.dist-info}/METADATA +2 -1
  71. shepherd_core-2024.5.1.dist-info/RECORD +75 -0
  72. shepherd_core-2024.4.1.dist-info/RECORD +0 -64
  73. /shepherd_core/data_models/{doc_virtual_source.py → virtual_source_doc.txt} +0 -0
  74. {shepherd_core-2024.4.1.dist-info → shepherd_core-2024.5.1.dist-info}/WHEEL +0 -0
  75. {shepherd_core-2024.4.1.dist-info → shepherd_core-2024.5.1.dist-info}/top_level.txt +0 -0
  76. {shepherd_core-2024.4.1.dist-info → shepherd_core-2024.5.1.dist-info}/zip-safe +0 -0
@@ -0,0 +1,88 @@
1
+ ## Datastructure
2
+
3
+ ### experiment-structure
4
+
5
+ - basics
6
+ - scheduling
7
+ - **SystemLogger**
8
+ - ~~AuxPort~~
9
+ - TargetConfigs
10
+ - Programming
11
+ - PowerTracer
12
+ - GpioTracer
13
+ - GpioActuator
14
+ - vSrc
15
+ - vHarvester
16
+ - [vConverter]
17
+
18
+ ## TODO
19
+
20
+ - establish internal variables ``_var``
21
+ - descriptions to parameters (docstring on sub-models)
22
+ - @kai
23
+ - firmwares
24
+ - programmer-ports determine IC
25
+ - memory read - family-code, or write factory
26
+ - when tracing v_intermediate, also this current, or output?
27
+ - ``objcopy -O ihex input.elf output.hex``
28
+ - ``-S`` will strip useless sections
29
+ - ``-I ihex -O elf32-littlearm`` for reversal is also possible
30
+ - TODO: try to find ``objdump -t [elf_file] | grep SHEPHERD_NODE_ID``
31
+
32
+ - title in class might be rubbish
33
+
34
+ - Warn about tricky syntax
35
+ - defining sub-data-models in an experiment in python:
36
+ - experiments-default: don't mention argument in init
37
+ - trace-default: init trace with empty argument list
38
+ - disable: init with "None"
39
+ - defining experiment in yaml:
40
+ - experiment-default: don't mention it
41
+ - trace-default: NOT POSSIBLE, right?
42
+ - disable: init with "null" OR just mention parameter but keep it empty
43
+
44
+ ### add documentation after creation ⇾ avoid Field()
45
+
46
+ - these do not work
47
+
48
+ ```Python
49
+ from pydantic import Field
50
+ from shepherd_core.data_models import ShpModel
51
+
52
+ class Experiment(ShpModel, title="Config of an Experiment"):
53
+ def __init__(self): # test to add doc after creation ⇾ to avoid Field()
54
+ super().__init__()
55
+ self.Config.fields["output_path"].description = "test description"
56
+ class Config:
57
+ fields: dict[str, Field] = {}
58
+ fields["output_path"] = Field(description="test description")
59
+ ```
60
+
61
+ ### simplify init of pydantic-class
62
+
63
+ What I want: init a fixture-class with Class("name") or Class(ID) instead of Class(name="name")
64
+
65
+ What does not work:
66
+
67
+ ```Python
68
+ from pathlib import Path
69
+ from typing import Union
70
+ from pydantic import root_validator
71
+ from shepherd_core.data_models import Fixture
72
+ from shepherd_core.data_models import ShpModel
73
+
74
+ fixtures = Fixture(Path("fix.yaml"), "testbed.target")
75
+
76
+
77
+ class Target(ShpModel, title="Target Node (DuT)"):
78
+ @root_validator(pre=True)
79
+ def query_database(cls, values: Union[dict, str, int]):
80
+ values = fixtures.try_completing_model(values)
81
+ values, chain = fixtures.try_inheritance(values)
82
+ return values
83
+ ```
84
+
85
+ what might work:
86
+
87
+ - writing a custom __init__() and putting lookup() there
88
+ - wait for V2
@@ -1,3 +1,8 @@
1
+ """Module for task-related data-modules.
2
+
3
+ These models import externally from all other model-modules!
4
+ """
5
+
1
6
  from pathlib import Path
2
7
  from typing import List
3
8
  from typing import Optional
@@ -33,7 +38,9 @@ __all__ = [
33
38
 
34
39
 
35
40
  def prepare_task(config: Union[ShpModel, Path, str], observer: Optional[str] = None) -> Wrapper:
36
- """- Opens file (from Path or str of Path)
41
+ """Open file and extract tasks.
42
+
43
+ - Open file (from Path or str of Path)
37
44
  - wraps task-model
38
45
  - and if it's an TestbedTasks it will extract the correct ObserverTask
39
46
  """
@@ -50,7 +57,7 @@ def prepare_task(config: Union[ShpModel, Path, str], observer: Optional[str] = N
50
57
  parameters=config.model_dump(),
51
58
  )
52
59
  else:
53
- raise ValueError("had unknown input: %s", type(config))
60
+ raise TypeError("had unknown input: %s", type(config))
54
61
 
55
62
  if shp_wrap.datatype == TestbedTasks.__name__:
56
63
  if observer is None:
@@ -72,7 +79,7 @@ def prepare_task(config: Union[ShpModel, Path, str], observer: Optional[str] = N
72
79
 
73
80
 
74
81
  def extract_tasks(shp_wrap: Wrapper, *, no_task_sets: bool = True) -> List[ShpModel]:
75
- """ """
82
+ """Make the individual task-sets usable for each observer."""
76
83
  if shp_wrap.datatype == ObserverTasks.__name__:
77
84
  obt = ObserverTasks(**shp_wrap.parameters)
78
85
  content = obt.get_tasks()
@@ -1,3 +1,5 @@
1
+ """Configuration for the Observer in Emulation-Mode."""
2
+
1
3
  import copy
2
4
  from datetime import datetime
3
5
  from datetime import timedelta
@@ -26,10 +28,10 @@ from ..testbed.cape import TargetPort
26
28
 
27
29
 
28
30
  class Compression(str, Enum):
29
- lzf = "lzf" # not native hdf5
30
- gzip1 = 1 # higher compr & load
31
- gzip = 1
32
- default = "lzf"
31
+ """Options for choosing a dataset-compression."""
32
+
33
+ lzf = default = "lzf" # not native hdf5
34
+ gzip1 = gzip = 1 # higher compr & load
33
35
  null = None
34
36
  # NOTE: changed to lzf as BBB needs every straw it can get
35
37
 
@@ -39,7 +41,7 @@ c_translate = {"lzf": "lzf", "1": 1, "None": None, None: None}
39
41
 
40
42
 
41
43
  class EmulationTask(ShpModel):
42
- """Configuration for the Observer in Emulation-Mode"""
44
+ """Configuration for the Observer in Emulation-Mode."""
43
45
 
44
46
  # General config
45
47
  input_path: Path
@@ -58,7 +60,7 @@ class EmulationTask(ShpModel):
58
60
  # timestamp or unix epoch time, None = ASAP
59
61
  duration: Optional[timedelta] = None
60
62
  # ⤷ Duration of recording in seconds, None = till EOF
61
- abort_on_error: bool = False
63
+ abort_on_error: bool = False # TODO: remove, should not exist
62
64
 
63
65
  # emulation-specific
64
66
  use_cal_default: bool = False
@@ -111,10 +113,11 @@ class EmulationTask(ShpModel):
111
113
  has_time = self.time_start is not None
112
114
  time_now = datetime.now().astimezone()
113
115
  if has_time and self.time_start < time_now:
114
- raise ValueError(
116
+ msg = (
115
117
  "Start-Time for Emulation can't be in the past "
116
118
  f"('{self.time_start}' vs '{time_now}'."
117
119
  )
120
+ raise ValueError(msg)
118
121
  if self.duration and self.duration.total_seconds() < 0:
119
122
  raise ValueError("Task-Duration can't be negative.")
120
123
  if isinstance(self.voltage_aux, str) and self.voltage_aux not in {
@@ -1,3 +1,5 @@
1
+ """Config for Task that adds the custom ID to the firmware & stores it into a file."""
2
+
1
3
  import copy
2
4
  from pathlib import Path
3
5
  from typing import Optional
@@ -24,7 +26,7 @@ from ..testbed.target import MCUPort
24
26
 
25
27
 
26
28
  class FirmwareModTask(ShpModel):
27
- """Config for Task that adds the custom ID to the firmware & stores it into a file"""
29
+ """Config for Task that adds the custom ID to the firmware & stores it into a file."""
28
30
 
29
31
  data: Union[FirmwareStr, Path]
30
32
  data_type: FirmwareDType
@@ -79,7 +81,7 @@ class FirmwareModTask(ShpModel):
79
81
  **kwargs: Unpack[TypedDict],
80
82
  ) -> Self:
81
83
  if not isinstance(fw, Firmware):
82
- raise ValueError("fw-argument must be of type Firmware")
84
+ raise TypeError("fw-argument must be of type Firmware")
83
85
  kwargs["data"] = fw.data
84
86
  kwargs["data_type"] = fw.data_type
85
87
  fw.compare_hash()
@@ -1,3 +1,5 @@
1
+ """Config for the Observer in Harvest-Mode to record IV data from a harvesting-source."""
2
+
1
3
  from datetime import datetime
2
4
  from datetime import timedelta
3
5
  from pathlib import Path
@@ -17,9 +19,7 @@ from .emulation import Compression
17
19
 
18
20
 
19
21
  class HarvestTask(ShpModel):
20
- """Configuration for the Observer in Harvest-Mode
21
- Record IV data from a harvest-source
22
- """
22
+ """Config for the Observer in Harvest-Mode to record IV data from a harvesting-source."""
23
23
 
24
24
  # General config
25
25
  output_path: Path
@@ -73,10 +73,11 @@ class HarvestTask(ShpModel):
73
73
  has_time = self.time_start is not None
74
74
  time_now = datetime.now().astimezone()
75
75
  if has_time and self.time_start < time_now:
76
- raise ValueError(
76
+ msg = (
77
77
  "Start-Time for Emulation can't be in the past "
78
78
  f"('{self.time_start}' vs '{time_now}'."
79
79
  )
80
+ raise ValueError(msg)
80
81
  if self.duration and self.duration.total_seconds() < 0:
81
82
  raise ValueError("Task-Duration can't be negative.")
82
83
  return self
@@ -1,3 +1,5 @@
1
+ """Collection of tasks for selected observer included in experiment."""
2
+
1
3
  from datetime import datetime
2
4
  from datetime import timedelta
3
5
  from pathlib import Path
@@ -18,7 +20,7 @@ from .programming import ProgrammingTask
18
20
 
19
21
 
20
22
  class ObserverTasks(ShpModel):
21
- """Collection of tasks for selected observer included in experiment"""
23
+ """Collection of tasks for selected observer included in experiment."""
22
24
 
23
25
  observer: NameStr
24
26
  owner_id: Optional[IdInt] # TODO: set to optional for now, shouldn't be
@@ -1,3 +1,5 @@
1
+ """Config for a Task programming the selected target."""
2
+
1
3
  import copy
2
4
  from pathlib import Path
3
5
  from typing import Optional
@@ -21,7 +23,7 @@ from ..testbed.testbed import Testbed
21
23
 
22
24
 
23
25
  class ProgrammingTask(ShpModel):
24
- """Config for Task programming the target selected"""
26
+ """Config for a Task programming the selected target."""
25
27
 
26
28
  firmware_file: Path
27
29
  target_port: TargetPort = TargetPort.A
@@ -1,3 +1,5 @@
1
+ """Collection of tasks for all observers included in experiment."""
2
+
1
3
  from typing import List
2
4
  from typing import Optional
3
5
 
@@ -15,7 +17,7 @@ from .observer_tasks import ObserverTasks
15
17
 
16
18
 
17
19
  class TestbedTasks(ShpModel):
18
- """Collection of tasks for all observers included in experiment"""
20
+ """Collection of tasks for all observers included in experiment."""
19
21
 
20
22
  name: NameStr
21
23
  observer_tasks: Annotated[List[ObserverTasks], Field(min_length=1, max_length=128)]
@@ -1,3 +1,8 @@
1
+ """Module for testbed-related data-models.
2
+
3
+ These models import externally from: /base
4
+ """
5
+
1
6
  from .cape import Cape
2
7
  from .cape import TargetPort
3
8
  from .gpio import GPIO
@@ -10,8 +15,6 @@ from .target import IdInt16
10
15
  from .target import Target
11
16
  from .testbed import Testbed
12
17
 
13
- # these models import externally from: /base
14
-
15
18
  __all__ = [
16
19
  "Testbed",
17
20
  "Observer",
@@ -1,3 +1,5 @@
1
+ """meta-data representation of a testbed-component (physical object)."""
2
+
1
3
  from datetime import date
2
4
  from datetime import datetime
3
5
  from enum import Enum
@@ -15,14 +17,14 @@ from ..base.shepherd import ShpModel
15
17
 
16
18
 
17
19
  class TargetPort(str, Enum):
18
- A = "A"
19
- B = "B"
20
- a = "A"
21
- b = "B"
20
+ """Options for choosing a target-port."""
21
+
22
+ A = a = "A"
23
+ B = b = "B"
22
24
 
23
25
 
24
26
  class Cape(ShpModel, title="Shepherd-Cape"):
25
- """meta-data representation of a testbed-component (physical object)"""
27
+ """meta-data representation of a testbed-component (physical object)."""
26
28
 
27
29
  id: IdInt
28
30
  name: NameStr
@@ -0,0 +1,94 @@
1
+ ---
2
+
3
+ # more human-readable test-protocol @
4
+ # https://github.com/orgua/shepherd_v2_planning/blob/main/doc_testbed/Cape_pre-deployment-tests.xlsx
5
+ - datatype: cape
6
+ parameters:
7
+ id: 1270051
8
+ name: cape51
9
+ version: v2.4b
10
+ description: full version with Hrv & Emu, modded gpio,emu,hrv
11
+ created: 2022-10-07
12
+ calibrated: 2023-09-21
13
+ - datatype: cape
14
+ parameters:
15
+ inherit_from: cape51
16
+ id: 1270052
17
+ name: cape52
18
+ - datatype: cape
19
+ parameters:
20
+ inherit_from: cape51
21
+ id: 1270053
22
+ name: cape53
23
+ description: full version with Hrv & Emu, partially modded
24
+ comment: 1st Lab Prototype, burned VReg -> currently defective
25
+ active: false
26
+ - datatype: cape
27
+ parameters:
28
+ inherit_from: cape51
29
+ id: 1270054
30
+ name: cape54
31
+ - datatype: cape
32
+ parameters:
33
+ inherit_from: cape51
34
+ id: 1270055
35
+ name: cape55
36
+ comment: Target-Port B, C-Meas failed on first Cal
37
+ - datatype: cape
38
+ parameters:
39
+ inherit_from: cape51
40
+ id: 1270056
41
+ name: cape56
42
+ - datatype: cape
43
+ parameters:
44
+ inherit_from: cape51
45
+ id: 1270057
46
+ name: cape57
47
+ comment: 2nd Lab Prototype, has stackable headers
48
+ - datatype: cape
49
+ parameters:
50
+ inherit_from: cape51
51
+ id: 1270058
52
+ name: cape58
53
+ comment: has shields on emu & hrv-circuits -> no effect on RF-Performance
54
+ - datatype: cape
55
+ parameters:
56
+ inherit_from: cape51
57
+ id: 1270059
58
+ name: cape59
59
+ comment: only 220u/440uF on 5V
60
+ - datatype: cape
61
+ parameters:
62
+ inherit_from: cape51
63
+ id: 1270060
64
+ name: cape60
65
+ comment: 3rd Lab Prototype
66
+ - datatype: cape
67
+ parameters:
68
+ inherit_from: cape51
69
+ id: 1270061
70
+ name: cape61
71
+ comment: only 220u/440uF on 5V
72
+ - datatype: cape
73
+ parameters:
74
+ inherit_from: cape51
75
+ id: 1270062
76
+ name: cape62
77
+ - datatype: cape
78
+ parameters:
79
+ inherit_from: cape51
80
+ id: 1270063
81
+ name: cape63
82
+ comment: only 220u/440uF on 5V
83
+ - datatype: cape
84
+ parameters:
85
+ inherit_from: cape51
86
+ id: 1270064
87
+ name: cape64
88
+ comment: only 220u/440uF on 5V, had 6x74LVC2T45GT flippend (U11,12,23,24,27,28) - hot air repair
89
+ - datatype: cape
90
+ parameters:
91
+ inherit_from: cape51
92
+ id: 1270065
93
+ name: cape65
94
+ comment: only 220u/440uF on 5V
@@ -1,3 +1,5 @@
1
+ """meta-data representation of a testbed-component (physical object)."""
2
+
1
3
  from enum import Enum
2
4
  from typing import Optional
3
5
 
@@ -15,16 +17,15 @@ from ..base.shepherd import ShpModel
15
17
 
16
18
 
17
19
  class Direction(str, Enum):
18
- Input = "IN"
19
- IN = "IN"
20
- Output = "OUT"
21
- OUT = "OUT"
22
- Bidirectional = "IO"
23
- IO = "IO"
20
+ """Options for pin-direction."""
21
+
22
+ Input = IN = "IN"
23
+ Output = OUT = "OUT"
24
+ Bidirectional = IO = "IO"
24
25
 
25
26
 
26
27
  class GPIO(ShpModel, title="GPIO of Observer Node"):
27
- """meta-data representation of a testbed-component"""
28
+ """meta-data representation of a testbed-component."""
28
29
 
29
30
  id: IdInt
30
31
  name: NameStr
@@ -54,10 +55,11 @@ class GPIO(ShpModel, title="GPIO of Observer Node"):
54
55
  no_pru = (self.reg_pru is None) or (self.pin_pru is None)
55
56
  no_sys = (self.reg_sys is None) or (self.pin_sys is None)
56
57
  if no_pru and no_sys:
57
- raise ValueError(
58
+ msg = (
58
59
  "GPIO-Instance is faulty -> "
59
60
  f"it needs to use pru or sys, content: {self.model_dump()}"
60
61
  )
62
+ raise ValueError(msg)
61
63
  return self
62
64
 
63
65
  def user_controllable(self) -> bool:
@@ -0,0 +1,166 @@
1
+ --- # add with >>> python manage.py loaddata <fixturename>
2
+ # cape v2.4
3
+ - datatype: gpio
4
+ parameters:
5
+ id: 1000
6
+ name: GPIO0
7
+ # description:
8
+ # comment:
9
+ direction: IO
10
+ dir_switch: DIR1
11
+ reg_pru: r31_00
12
+ pin_pru: P8_45
13
+ reg_sys: 26
14
+ pin_sys: P8_14
15
+ - datatype: gpio
16
+ parameters:
17
+ id: 1001
18
+ name: GPIO1
19
+ direction: IO
20
+ dir_switch: DIR1
21
+ reg_pru: r31_01
22
+ pin_pru: P8_46
23
+ reg_sys: 27
24
+ pin_sys: P8_17
25
+ - datatype: gpio
26
+ parameters:
27
+ id: 1002
28
+ name: GPIO2
29
+ direction: IO
30
+ dir_switch: DIR1
31
+ reg_pru: r31_02
32
+ pin_pru: P8_43
33
+ reg_sys: 46
34
+ pin_sys: P8_16
35
+ - datatype: gpio
36
+ parameters:
37
+ id: 1003
38
+ name: GPIO3
39
+ direction: IO
40
+ dir_switch: DIR1
41
+ reg_pru: r31_03
42
+ pin_pru: P8_44
43
+ reg_sys: 47
44
+ pin_sys: P8_15
45
+ - datatype: gpio
46
+ parameters:
47
+ id: 1004
48
+ name: GPIO4
49
+ direction: IN
50
+ reg_pru: r31_04
51
+ pin_pru: P8_41
52
+ reg_sys: 61
53
+ pin_sys: P8_26
54
+ - datatype: gpio
55
+ parameters:
56
+ id: 1005
57
+ name: GPIO5
58
+ direction: IN
59
+ reg_pru: r31_05
60
+ pin_pru: P8_42
61
+ reg_sys: 80
62
+ pin_sys: P8_36
63
+ - datatype: gpio
64
+ parameters:
65
+ id: 1006
66
+ name: GPIO6
67
+ direction: IN
68
+ reg_pru: r31_06
69
+ pin_pru: P8_39
70
+ reg_sys: 81
71
+ pin_sys: P8_34
72
+ - datatype: gpio
73
+ parameters:
74
+ id: 1007
75
+ name: GPIO7
76
+ description: alias UART_RX
77
+ direction: IN
78
+ reg_pru: r31_07
79
+ pin_pru: P8_40
80
+ reg_sys: 14
81
+ pin_sys: P9_26
82
+ - datatype: gpio
83
+ parameters:
84
+ id: 1008
85
+ name: GPIO8
86
+ description: alias UART_TX
87
+ direction: IO
88
+ dir_switch: DIR2
89
+ reg_pru: r31_08
90
+ pin_pru: P8_27
91
+ reg_sys: 15
92
+ pin_sys: P9_24
93
+ - datatype: gpio
94
+ parameters:
95
+ id: 1009
96
+ name: BAT_OK
97
+ description: signal from vSource (PRU) to target
98
+ direction: OUT
99
+ reg_pru: r30_09
100
+ pin_pru: P8_29
101
+ - datatype: gpio
102
+ parameters:
103
+ id: 2000
104
+ name: PRG1_CLK
105
+ description: alias JTAG_TCK
106
+ direction: OUT
107
+ reg_sys: 5
108
+ pin_sys: P9_17
109
+ - datatype: gpio
110
+ parameters:
111
+ id: 2001
112
+ name: PRG1_IO
113
+ description: alias JTAG_TDI
114
+ direction: IO
115
+ dir_switch: PDIR1
116
+ reg_sys: 4
117
+ pin_sys: P9_18
118
+ - datatype: gpio
119
+ parameters:
120
+ id: 2010
121
+ name: PRG2_CLK
122
+ description: alias JTAG_TDO
123
+ direction: OUT
124
+ reg_sys: 8
125
+ pin_sys: P8_35
126
+ - datatype: gpio
127
+ parameters:
128
+ id: 2011
129
+ name: PRG2_IO
130
+ description: alias JTAG_TMS
131
+ direction: IO
132
+ dir_switch: PDIR2
133
+ reg_sys: 9
134
+ pin_sys: P8_33
135
+ - datatype: gpio
136
+ parameters:
137
+ id: 3000
138
+ name: DIR1
139
+ description: changes direction of GPIO[0:3]
140
+ direction: OUT
141
+ reg_sys: 78
142
+ pin_sys: P8_37
143
+ - datatype: gpio
144
+ parameters:
145
+ id: 3001
146
+ name: DIR2
147
+ description: changes direction of GPIO8
148
+ direction: OUT
149
+ reg_sys: 79
150
+ pin_sys: P8_38
151
+ - datatype: gpio
152
+ parameters:
153
+ id: 3002
154
+ name: PDIR1
155
+ description: changes direction PRG1_IO
156
+ direction: OUT
157
+ reg_sys: 10
158
+ pin_sys: P8_31
159
+ - datatype: gpio
160
+ parameters:
161
+ id: 3003
162
+ name: PDIR2
163
+ description: changes direction PRG2_IO
164
+ direction: OUT
165
+ reg_sys: 11
166
+ pin_sys: P8_32
@@ -1,3 +1,5 @@
1
+ """meta-data representation of a testbed-component (physical object)."""
2
+
1
3
  from enum import Enum
2
4
  from typing import Optional
3
5
 
@@ -13,18 +15,16 @@ from ..base.shepherd import ShpModel
13
15
 
14
16
 
15
17
  class ProgrammerProtocol(str, Enum):
16
- SWD = "SWD"
17
- swd = "SWD"
18
- SBW = "SBW"
19
- sbw = "SBW"
20
- JTAG = "JTAG"
21
- jtag = "JTAG"
22
- UART = "UART"
23
- uart = "UART"
18
+ """Options regarding the programming-protocol."""
19
+
20
+ SWD = swd = "SWD"
21
+ SBW = sbw = "SBW"
22
+ JTAG = jtag = "JTAG"
23
+ UART = uart = "UART"
24
24
 
25
25
 
26
26
  class MCU(ShpModel, title="Microcontroller of the Target Node"):
27
- """meta-data representation of a testbed-component (physical object)"""
27
+ """meta-data representation of a testbed-component (physical object)."""
28
28
 
29
29
  id: IdInt
30
30
  name: NameStr
@@ -0,0 +1,19 @@
1
+ --- # add with >>> python manage.py loaddata <fixturename>
2
+ - datatype: mcu
3
+ parameters:
4
+ id: 1001
5
+ name: nRF52
6
+ description: Panasonic PAN1780, ENW-89854A1KF, Bluetooth 5 Low Energy Module
7
+ platform: nRF52
8
+ core: nRF52840
9
+ prog_protocol: SWD
10
+ fw_name_default: nrf52_demo_rf
11
+ - datatype: mcu
12
+ parameters:
13
+ id: 1002
14
+ name: MSP430FR
15
+ description: 16MHz Ultra-Low-Pwr MCU with 128 KB FRAM
16
+ platform: MSP430
17
+ core: MSP430FR5962
18
+ prog_protocol: SBW
19
+ fw_name_default: msp430_deep_sleep