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

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_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_RTC (1)

View File

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

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):
self.board_pin = True
def print(self):
print('pin_obj_t pin_{:6s} = PIN({:6s}, {:1d}, {:3d}, {:2d});'.format(
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:
if pin.port == port and pin.gpio_bit == gpio_bit:
return pin
def find_pin_by_num(self, pin_num):
for pin in self.cpu_pins:
if pin.pin_num == pin_num:
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):
with open(filename, 'r') as csvfile:
rows = csv.reader(csvfile)
@ -76,13 +81,16 @@ class Pins(object):
pin_num = int(row[pin_col]) - 1;
pin = Pin(row[pinname_col], port_num, gpio_bit, pin_num)
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:
rows = csv.reader(csvfile)
for row in rows:
# 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:
pin.set_is_board_pin()