mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-15 10:47:52 -06:00
pru: Use enumerations for pin mappings
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
91cf497656
commit
ae24baf99a
3 changed files with 8 additions and 13 deletions
|
@ -13,18 +13,7 @@ class error(Exception):
|
|||
# Hardware pin names
|
||||
######################################################################
|
||||
|
||||
def named_pins(fmt, port_count, bit_count=32):
|
||||
return { fmt % (port, portbit) : port * bit_count + portbit
|
||||
for port in range(port_count)
|
||||
for portbit in range(bit_count) }
|
||||
|
||||
def beaglebone_pins():
|
||||
gpios = named_pins("gpio%d_%d", 4)
|
||||
gpios.update({"AIN%d" % i: i+4*32 for i in range(8)})
|
||||
return gpios
|
||||
|
||||
MCU_PINS = {
|
||||
"pru": beaglebone_pins(),
|
||||
"linux": {"analog%d" % i: i for i in range(8)}, # XXX
|
||||
}
|
||||
|
||||
|
@ -141,8 +130,7 @@ beagleboneblack_mappings = {
|
|||
def update_map_beaglebone(pins, mcu):
|
||||
if mcu != 'pru':
|
||||
raise error("Beaglebone aliases not supported on mcu '%s'" % (mcu,))
|
||||
for pin, gpio in beagleboneblack_mappings.items():
|
||||
pins[pin] = pins[gpio]
|
||||
pins.update(beagleboneblack_mappings)
|
||||
|
||||
|
||||
######################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue