lpc176x: Add support for GPIO pins

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2018-05-08 12:20:10 -04:00
parent 970831ee0d
commit c78b90767f
4 changed files with 120 additions and 1 deletions

View File

@@ -25,6 +25,10 @@ def named_pins(fmt, port_count, bit_count=32):
for port in range(port_count)
for portbit in range(bit_count) }
def lpc_pins():
return { 'P%d.%d' % (port, pin) : port * 32 + pin
for port in range(5) for pin in range(32) }
def beaglebone_pins():
gpios = named_pins("gpio%d_%d", 4)
gpios.update({"AIN%d" % i: i+4*32 for i in range(8)})
@@ -37,6 +41,7 @@ MCU_PINS = {
"atmega1280": port_pins(12), "atmega2560": port_pins(12),
"sam3x8e": port_pins(4, 32),
"stm32f103": port_pins(5, 16),
"lpc176x": lpc_pins(),
"pru": beaglebone_pins(),
"linux": {"analog%d" % i: i for i in range(8)}, # XXX
}