This board uses both CPU and a DIO controller in the FPGA. The CPU DIO typically has 1-7 functions associated with various pins (I2C, PWM, SPI, etc). See the CPU manual CPU manual for the complete listing and for information on how to control these DIO. For purposes of identity, all FPGA DIO will be labelled DIO_n (where n is the DIO pin number), and all CPU dio will be labelled MFP_n.
Bit masking: Any bits not expressly mentioned here should be masked out. Direction setting: 0 is input, 1 is output.
All FPGA DIO are controlled by three distinct register types: Direction, Input Data, and Output Data. To use any DIO pin, the direction register must be set (0 for input, 1 for output), then either the input register may be read, or the output register may be written to. These registers are described in the Syscon memory table.
For example, to write to DIO_0, bit 0 (the LSB) of 0x80004018 (The direction register for DIO_0 through DIO_14) must be set high, then the desired value (high = 1 low = 0) should be written to bit 0 of 0x80004010 (the Output Data register for DIO_0 through DIO_14). Alternatively to read the status of that pin, the Direction Register must be set low, then bit zero of 0x80004020 would reflect the status of that pin.
Full details on CPU pins can be found in the CPU manual, along with mode and mapping assignments specific to the CPU. As this comprises twelve pages of material that must be completely understood, it is best to read the CPU manual carefully before making use of these pins.
The pages of interest in the CPU manual regarding the MFP_n pins start at page A-5 and continue through page A-12 under section A.1. General information for DIO access is given here for convenience: CPU GPIO Register base: 0xD4019000 The offsets table for the CPU GPIO pins is on pages A-7 through A-9. The register description for each pin's register is located on pages A-9 through A-12.
All 60 of the DIO from the FPGA will default to the DIO mode. These pins coming from the FPGA are all 3.3V tolerant. To manipulate these DIO you can access the #Syscon. The initrd also has ts4700.subr which has functions for manipulating the DIO through shell functions:
# If you're in the initrd: source /ts4700.subr # If you're in Debian: source /initrd/ts4700.subr #Usage: setdiopin <pin> <1,0,Z> <b> setdiopin 8 0 #Usage: getdiopin <pin> getdiopin 9
|DIO Number||Connector Location||Alternate Function|
|0||CN1_93||Offboard IRQ 67|
|1||CN1_91||Offboard IRQ 68|
|2||CN1_89||Offboard IRQ 69|
|4||CN1_85||XUART5 CTS, edge counter 0 input|
|6||CN1_81||Edge counter 1 input|
|7||CN1_79||XUART5 TX_EN, ADC_CLK|
|8||CN1_77||AN_SEL, XUART1 TX_EN|
|10||CN1_71||CAN2_TXD, XUART2 TX_EN|
|13||CN1_65||XUART6 RXD, XUART3_TXEN|