3 use strict qw(refs vars);
10 m/^(\w+)\:(\d+)$/ or die "$_ ?";
11 foreach (my $i=0; $i<$2; $i++) { push @boards, $1; }
17 m/^(\d+)\t(\S.*\S)\s+/ or die;
19 $pin2otherdesc[$1]= $2;
23 foreach my $board (0..$#boards) {
24 my $bkind= $boards[$board];
25 next if exists $boardpin2point{$bkind};
26 open NI, "$bkind.net-info" or die "$bkind $!";
29 while (s/\\\n$//) { $_ .= <NI>; }
32 my ($netname, $type, $pins) = m/^(\w+)\s+(\w+)\s+(\S.*)?$/
34 next unless defined $pins;
36 $pins =~ m/\sPIC-(\d+)\s/ or next;
38 $netname= "__${netname}__";
39 $netname =~ m/__pt(\d+)__/ or next;
41 die "$netname $pin" unless defined $pin2otherdesc[$pin];
42 $boardpin2point{$bkind}[$pin]= $point;
44 NI->error and die "$bkind $!";
67 my $format= join ' | ', @formats;
68 my $formatname= $formats{$format};
69 if (!defined $formatname) {
70 $formatname= $nextformat++;
71 $formats{$format}= $formatname;
72 print " ${formatname}format { $format }\n";
74 $body .= "\@Row${formatname}\n ".join("\n ", @cells)."\n";
79 my ($fmt, $data) = @_;
80 my $ix= $cellix++; #"C".scalar @cells;
81 push @formats, '@Cell '.$fmt." $ix";
82 push @cells, "$ix { $data }";
87 cell('', '@B { alternative uses }');
88 foreach my $board (0..$#boards) {
89 cell('', "$boards[$board]");
93 foreach my $pin (@pins) {
96 cell('', "\"$pin2otherdesc[$pin]\"");
97 foreach my $board (0..$#boards) {
98 my $point= $boardpin2point{$boards[$board]}[$pin];
99 if (!defined $point) {
100 cell('paint { lightgrey }', '');
102 cell('', "PT$point");
107 print "{\n",$body,"}\n";
113 STDOUT->error and die $!;
116 40 (useable for point only)
117 39 (useable for point only)
118 38 Interrupt on change
119 37 Interrupt on change
121 35 External Interrupt 2
122 34 External Interrupt 1
123 33 External Interrupt 0
124 30 ECCP1 PWM output D
125 29 ECCP1 PWN output C
126 28 ECCP1 PWN output B
127 27 ECCP1 PWN output A
131 22 Comparator 2 input
132 2 Analogue in 0 / Comparator ref out
134 15 Timer 1 osc out / Timer 1,3 ext clock in