Skip to content

Commit 5066c59

Browse files
authored
Improve categorizations (again), add XIAO RP2040 (#345)
Improve categorization - Better classification of DiscreteComponents instead of InternalSubcircuit - Remove InternalBlock from super-superclasses of some microcontrollers - anything inheriting InternalBlock (even transitively) is internal Add XIAO RP2040 and a basic keyboard example that uses the dev board.
1 parent 0788698 commit 5066c59

15 files changed

+715
-144
lines changed

electronics_abstract_parts/AbstractFuse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
@abstract_block
11-
class Fuse(InternalSubcircuit, Block):
11+
class Fuse(DiscreteComponent, Block):
1212
@init_in_parent
1313
def __init__(self, trip_current: RangeLike, *, hold_current: RangeLike = RangeExpr.ALL,
1414
voltage: RangeLike = RangeExpr.ZERO) -> None:

electronics_abstract_parts/AbstractJumper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from electronics_model import *
2-
from .Categories import InternalSubcircuit, TypedJumper
2+
from .Categories import DiscreteComponent, TypedJumper
33

44

55
@abstract_block
6-
class Jumper(InternalSubcircuit, Block):
6+
class Jumper(DiscreteComponent, Block):
77
"""A two-ported passive-typed jumper (a disconnect-able connection), though is treated
88
as always connected for model purposes.
99

electronics_abstract_parts/Categories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class InternalSubcircuit(InternalBlock):
252252

253253

254254
@abstract_block
255-
class DiscreteComponent(InternalSubcircuit, Block):
255+
class DiscreteComponent(InternalBlock):
256256
"""Discrete component that typically provides untyped ports (not to be be used directly), as a component to be used in an application circuit."""
257257
pass
258258

electronics_abstract_parts/IoController.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
@abstract_block
12-
class BaseIoController(PinMappable, InternalBlock, Block):
12+
class BaseIoController(PinMappable, Block):
1313
"""An abstract IO controller block, that takes power input and provides a grab-bag of common IOs.
1414
A base interface for microcontrollers and microcontroller-like devices (eg, FPGAs).
1515
Pin assignments are handled via refinements and can be assigned to pins' allocated names.

electronics_abstract_parts/PassiveConnector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
@abstract_block
6-
class PassiveConnector(InternalSubcircuit, Block):
6+
class PassiveConnector(DiscreteComponent, Block):
77
"""A base Block that is an elastic n-ported connector with passive type.
88
Interface only, no implementation.
99

electronics_lib/Microcontroller_Esp32.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _io_pinmap(self) -> PinMapUtil:
140140

141141

142142
@abstract_block
143-
class Esp32_Base(Esp32_Ios, InternalSubcircuit, GeneratorBlock):
143+
class Esp32_Base(Esp32_Ios, GeneratorBlock):
144144
"""Base class for ESP32 series microcontrollers with WiFi and Bluetooth (classic and LE)
145145
146146
Chip datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
@@ -179,7 +179,7 @@ def _system_pinmap(self) -> Dict[str, CircuitPort]:
179179
}).remap(self.SYSTEM_PIN_REMAP)
180180

181181

182-
class Esp32_Wroom_32_Device(Esp32_Base, FootprintBlock, JlcPart):
182+
class Esp32_Wroom_32_Device(Esp32_Base, InternalSubcircuit, FootprintBlock, JlcPart):
183183
"""ESP32-WROOM-32 module
184184
185185
Module datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32e_esp32-wroom-32ue_datasheet_en.pdf

electronics_lib/Microcontroller_Esp32c3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _io_pinmap(self) -> PinMapUtil:
8787

8888

8989
@abstract_block
90-
class Esp32c3_Base(Esp32c3_Ios, InternalSubcircuit, BaseIoControllerPinmapGenerator):
90+
class Esp32c3_Base(Esp32c3_Ios, BaseIoControllerPinmapGenerator):
9191
"""Base class for ESP32-C3 series devices, with RISC-V core, 2.4GHz WiF,i, BLE5.
9292
PlatformIO: use board ID esp32-c3-devkitm-1
9393
@@ -127,7 +127,7 @@ def __init__(self, **kwargs) -> None:
127127
self.uart0 = self.Port(UartPort(dio_model), optional=True)
128128

129129

130-
class Esp32c3_Wroom02_Device(Esp32c3_Base, FootprintBlock, JlcPart):
130+
class Esp32c3_Wroom02_Device(Esp32c3_Base, InternalSubcircuit, FootprintBlock, JlcPart):
131131
"""ESP32C module
132132
133133
Module datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3-wroom-02_datasheet_en.pdf
@@ -211,7 +211,7 @@ def generate(self) -> None:
211211
gnd=self.gnd, pwr=self.pwr, io=self.ic.en)
212212

213213

214-
class Esp32c3_Device(Esp32c3_Base, FootprintBlock, JlcPart):
214+
class Esp32c3_Device(Esp32c3_Base, InternalSubcircuit, FootprintBlock, JlcPart):
215215
"""ESP32C3 with 4MB integrated flash
216216
TODO: support other part numbers, including without integrated flash
217217
"""

electronics_lib/Microcontroller_Esp32s3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def _io_pinmap(self) -> PinMapUtil:
146146

147147

148148
@abstract_block
149-
class Esp32s3_Base(Esp32s3_Ios, InternalSubcircuit, GeneratorBlock):
149+
class Esp32s3_Base(Esp32s3_Ios, GeneratorBlock):
150150
"""Base class for ESP32-S3 series microcontrollers with WiFi and Bluetooth (classic and LE)
151151
and AI acceleration
152152
@@ -180,7 +180,7 @@ def __init__(self, **kwargs) -> None:
180180
self.uart0 = self.Port(UartPort(dio_model), optional=True) # programming
181181

182182

183-
class Esp32s3_Wroom_1_Device(Esp32s3_Base, FootprintBlock, JlcPart):
183+
class Esp32s3_Wroom_1_Device(Esp32s3_Base, InternalSubcircuit, FootprintBlock, JlcPart):
184184
SYSTEM_PIN_REMAP: Dict[str, Union[str, List[str]]] = {
185185
'VDD': '2',
186186
'GND': ['1', '40', '41'], # 41 is EP

0 commit comments

Comments
 (0)