Add two extra GPIO banks to the peripherals #178
Labels
✨ feature
New things!
P-high
High priority
T-os
Topic: The LC-3 OS (TRAPs too)
T-peripheral traits
Topic: Peripheral Traits
what
We want to support use cases that require more than 8 GPIO pins. At the same time we don't want to limit device implementations of the platform to devices that have 24+ pins available.
So, it's time to introduce optional peripherals, something we've discussed before re: other peripherals like the
Disk
peripheral (#54).steps
Control
trait to support querying for the presence of optional peripheralsControl
trait to have methods for the extra gpio banks (get_states, get_readings)get_extra_gpio_states
/get_extra_gpio_readings
functions that take aGpioBank
arg but... I think it's okay to just modify the existingget_gpio_states
/get_gpio_readings
functions and for users to Know that the first bank will always be presentGB5
=1 * 8 + 5
=13
, etc., show a full table too (and then link to that section of the module level docs from all the GPIO TRAP docs)where
branch:
feat/extra-gpio-banks
open questions
Pin numbering? I see two options:
GA0
,GA1
, ...,GA7
,GB0
, ...,GB7
,GC0
, ...GpioPin
that'sG0
throughG7
so the upside to this option is that the internals match the names we're using externallyG0
, ...,G23
I've picked the 1st option for now (it doesn't seem too onerous to have students figure out that
GC3
->#19
, etc.) but I'm not totally sold on it.The text was updated successfully, but these errors were encountered: