cc3200: Correct WiPy's pinout and the pin generation script.

This commit is contained in:
danicampora 2015-03-12 12:36:56 +01:00
parent 6ae9383f63
commit d1ba8b7659
4 changed files with 62 additions and 56 deletions

View File

@ -1,25 +1,24 @@
P12,58 L2,GPIO2
P13,4 L3,GPIO1
P14,3 L4,GPIO23
P15,61 L5,GPIO24
P16,59 L6,GPIO11
P17,5 L7,GPIO12
P18,62 L8,GPIO13
P19,1 L9,GPIO14
P110,2 L10,GPIO15
P33,57 L11,GPIO16
P34,60 L12,GPIO17
P37,63 L13,GPIO22
P38,53 L14,GPIO28
P39,64 R4,GPIO10
P310,50 R5,GPIO9
P49,16 R6,GPIO8
P410,17 R7,GPIO7
P22,18 R8,GPIO6
P23,8 R9,GPIO30
P24,45 R10,GPIO31
P26,7 R11,GPIO3
P27,6 R12,GPIO0
P28,21 R13,GPIO4
P29,55 R14,GPIO5
P210,15

1 P12 L2 58 GPIO2
2 P13 L3 4 GPIO1
3 P14 L4 3 GPIO23
4 P15 L5 61 GPIO24
5 P16 L6 59 GPIO11
6 P17 L7 5 GPIO12
7 P18 L8 62 GPIO13
8 P19 L9 1 GPIO14
9 P110 L10 2 GPIO15
10 P33 L11 57 GPIO16
11 P34 L12 60 GPIO17
12 P37 L13 63 GPIO22
13 P38 L14 53 GPIO28
14 P39 R4 64 GPIO10
15 P310 R5 50 GPIO9
16 P49 R6 16 GPIO8
17 P410 R7 17 GPIO7
18 P22 R8 18 GPIO6
19 P23 R9 8 GPIO30
20 P24 R10 45 GPIO31
21 P26 R11 7 GPIO3
22 P27 R12 6 GPIO0
23 P28 R13 21 GPIO4
24 P29 R14 55 GPIO5
P210 15

View File

@ -30,7 +30,7 @@
#define MICROPY_HW_BOARD_NAME "WiPy_SD" #define MICROPY_HW_BOARD_NAME "WiPy_SD"
#define MICROPY_HW_MCU_NAME "CC3200" #define MICROPY_HW_MCU_NAME "CC3200"
#define MICROPY_HW_HAS_SDCARD (0) #define MICROPY_HW_HAS_SDCARD (1)
#define MICROPY_HW_ENABLE_RNG (1) #define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1) #define MICROPY_HW_ENABLE_RTC (1)

View File

@ -1,25 +1,24 @@
P12,58 L2,GPIO2
P13,4 L3,GPIO1
P14,3 L4,GPIO23
P15,61 L5,GPIO24
P16,59 L6,GPIO11
P17,5 L7,GPIO12
P18,62 L8,GPIO13
P19,1 L9,GPIO14
P110,2 L10,GPIO15
P33,57 L11,GPIO16
P34,60 L12,GPIO17
P37,63 L13,GPIO22
P38,53 L14,GPIO28
P39,64 R4,GPIO10
P310,50 R5,GPIO9
P49,16 R6,GPIO8
P410,17 R7,GPIO7
P22,18 R8,GPIO6
P23,8 R9,GPIO30
P24,45 R10,GPIO31
P26,7 R11,GPIO3
P27,6 R12,GPIO0
P28,21 R13,GPIO4
P29,55 R14,GPIO5
P210,15

1 P12 L2 58 GPIO2
2 P13 L3 4 GPIO1
3 P14 L4 3 GPIO23
4 P15 L5 61 GPIO24
5 P16 L6 59 GPIO11
6 P17 L7 5 GPIO12
7 P18 L8 62 GPIO13
8 P19 L9 1 GPIO14
9 P110 L10 2 GPIO15
10 P33 L11 57 GPIO16
11 P34 L12 60 GPIO17
12 P37 L13 63 GPIO22
13 P38 L14 53 GPIO28
14 P39 R4 64 GPIO10
15 P310 R5 50 GPIO9
16 P49 R6 16 GPIO8
17 P410 R7 17 GPIO7
18 P22 R8 18 GPIO6
19 P23 R9 8 GPIO30
20 P24 R10 45 GPIO31
21 P26 R11 7 GPIO3
22 P27 R12 6 GPIO0
23 P28 R13 21 GPIO4
24 P29 R14 55 GPIO5
P210 15

View File

@ -38,7 +38,7 @@ class Pin(object):
def set_is_board_pin(self): def set_is_board_pin(self):
self.board_pin = True self.board_pin = True
def print(self): def print(self):
print('pin_obj_t pin_{:6s} = PIN({:6s}, {:1d}, {:3d}, {:2d});'.format( print('pin_obj_t pin_{:6s} = PIN({:6s}, {:1d}, {:3d}, {:2d});'.format(
self.name, self.name, self.port, self.gpio_bit, self.pin_num)) self.name, self.name, self.port, self.gpio_bit, self.pin_num))
@ -56,12 +56,17 @@ class Pins(object):
for pin in self.cpu_pins: for pin in self.cpu_pins:
if pin.port == port and pin.gpio_bit == gpio_bit: if pin.port == port and pin.gpio_bit == gpio_bit:
return pin return pin
def find_pin_by_num(self, pin_num): def find_pin_by_num(self, pin_num):
for pin in self.cpu_pins: for pin in self.cpu_pins:
if pin.pin_num == pin_num: if pin.pin_num == pin_num:
return pin return pin
def find_pin_by_name(self, name):
for pin in self.cpu_pins:
if pin.name == name:
return pin
def parse_af_file(self, filename, pin_col, pinname_col): def parse_af_file(self, filename, pin_col, pinname_col):
with open(filename, 'r') as csvfile: with open(filename, 'r') as csvfile:
rows = csv.reader(csvfile) rows = csv.reader(csvfile)
@ -76,13 +81,16 @@ class Pins(object):
pin_num = int(row[pin_col]) - 1; pin_num = int(row[pin_col]) - 1;
pin = Pin(row[pinname_col], port_num, gpio_bit, pin_num) pin = Pin(row[pinname_col], port_num, gpio_bit, pin_num)
self.cpu_pins.append(pin) self.cpu_pins.append(pin)
def parse_board_file(self, filename, cpu_pin_num_col): def parse_board_file(self, filename, cpu_pin_col):
with open(filename, 'r') as csvfile: with open(filename, 'r') as csvfile:
rows = csv.reader(csvfile) rows = csv.reader(csvfile)
for row in rows: for row in rows:
# Pin numbers must start from 0 when used with the TI API # Pin numbers must start from 0 when used with the TI API
pin = self.find_pin_by_num(int(row[cpu_pin_num_col]) - 1) if row[cpu_pin_col].isdigit():
pin = self.find_pin_by_num(int(row[cpu_pin_col]) - 1)
else:
pin = self.find_pin_by_name(row[cpu_pin_col])
if pin: if pin:
pin.set_is_board_pin() pin.set_is_board_pin()