From 6f418fc1b068c1a41113bb2b019a5803765e1deb Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Tue, 22 Jul 2014 07:57:36 -0700 Subject: Add support for selecting pin alternate functions from python. Converts generted pins to use qstrs instead of string pointers. This patch also adds the following functions: pyb.Pin.names() pyb.Pin.af_list() pyb.Pin.gpio() dir(pyb.Pin.board) and dir(pyb.Pin.cpu) also produce useful results. pyb.Pin now takes kw args. pyb.Pin.__str__ now prints more useful information about the pin configuration. I found the following functions in my boot.py to be useful: ```python def pins(): for pin_name in dir(pyb.Pin.board): pin = pyb.Pin(pin_name) print('{:10s} {:s}'.format(pin_name, str(pin))) def af(): for pin_name in dir(pyb.Pin.board): pin = pyb.Pin(pin_name) print('{:10s} {:s}'.format(pin_name, str(pin.af_list()))) ``` --- teensy/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'teensy/main.c') diff --git a/teensy/main.c b/teensy/main.c index 53f500d57..8de26f25e 100644 --- a/teensy/main.c +++ b/teensy/main.c @@ -24,7 +24,7 @@ #include "usb.h" #include "led.h" #include "uart.h" -//#include "pin.h" +#include "pin.h" #include "pybstdio.h" @@ -272,7 +272,7 @@ soft_reset: readline_init0(); - //pin_init(); + pin_init0(); #if 0 // add some functions to the python namespace -- cgit v1.2.3