Hi,
I've got a need for some sed/awk/perl/python/... hackery. I've scraped
some data from a pinout table found in a datasheet pdf and would like to
import it into a spreadsheet. The data looks like this:
A,SDMMC0_CK,I/O,1
B,QSPI0_SCK,O,1
F,D0,I/O,2
A,SDMMC0_DAT3,I/O,1
B,QSPI0_IO3,I/O,1
F,D5,I/O,2
A,SDMMC0_DAT4,I/O,1
B,QSPI1_SCK,O,1
D,TIOA5,I/O,1
E,FLEXCOM2_IO0,I/O,1
F,D6,I/O,2
This data represents the available functionality of three GPIO pins.
Think pin mux'ing. Each leading letter represents a possible function
for a pin. In the above example, the first pin has functions A, B, and
F. Each pin could have 6 possible functions (A through F), but
typically has fewer. Thus the missing letters in the sequence. Note
that not every pin has an 'A' function. The goal is to put the function
info in the appropriate columns based on the leading letter. There
should be one line per pin. For the above data, the end result should
look something like this:
SDMMC0_CK,I/O,1,QSPI0_SCK,O,1,,,,,,,,,,D0,I/O,2
SDMMC0_DAT3,I/O,1,QSPI0_IO3,I/O,1,,,,,,,,,,D5,I/O,2
SDMMC0_DAT4,I/O,1,QSPI1_SCK,O,1,TIOA5,I/O,1,FLEXCOM2_IO0,I/O,1,D6,I/O,2
I did this by hand, so the comma count may be off, but hopefully it gets
the point across. Note that any of the functions A-F may be missing,
but there will always be at least one function per pin.
Suggestions on how to best accomplish this?
If you're really bored, here's the datasheet that I'm scraping. Look at
Table 6-2 beginning on page 13. I've already got most of the data from
this table through outside channels, but I'm missing the data from the
PIO Peripheral Signal column.
<http://ww1.microchip.com/downloads/en/DeviceDoc/SAMA5D2-Plus-DDR2-LPDDR2-System-in-Package-(SIP)-60001484b.pdf>
thanks,
galen
--
Galen Seitz
[email protected]
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug