• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1FTDI FT4222H                             {#ft4222}
2============
3
4The FT4222H is a High/Full Speed USB2.0-to-Quad SPI/I2C device controller. Mraa
5supports it as a USB subplatform using the libft4222 library from FTDI which
6can be found
7[here](http://www.ftdichip.com/Support/SoftwareExamples/libft4222-1.2.1.4.tgz).
8You need the latest version for the GPIO to work.
9
10The FT4222H has 4 configuration modes selected by {DCNF1, DCNF0}.  The chip
11configuration mode will determine the number of USB interfaces for data streams
12and for GPIOs control. Mraa supports chip modes CNFMODE0 and CNFMODE3. In
13CNFMODE0 the chip can provide either 4 GPIOs and SPI, or 2 GPIOs and I2C
14since SCL/SDA are shared with GPIO0/GPIO1. It is possible to change this
15selection dynamically by calling the corresponding mraa init functions.
16CNFMODE3 on the other hand will only provide SPI or I2C.
17
18By default, both modes start with I2C enabled and the driver will scan for
19known GPIO expanders on the I2C bus when the FT4222H is initialized.
20
21Supported GPIO expanders:
22* PCA9672
23* PCA9555
24* PCF8575
25
26Output from 'mraa-gpio list' would be as follows:
27~~~~~~~~~~~~~
28512 IGPIO0/SCL0: GPIO I2C
29513 IGPIO1/SDA0: GPIO I2C
30514   INT-GPIO2: GPIO
31515   INT-GPIO3: GPIO
32~~~~~~~~~~~~~
33
34When an I2C GPIO expander is present, the pins on the expander will appear after
35the 4 FT4222H GPIO pins (i.e. starting at physical pin #4, logical pin #516).
36~~~~~~~~~~~~~
37512 IGPIO0/SCL0: GPIO I2C
38513 IGPIO1/SDA0: GPIO I2C
39514   INT-GPIO2: GPIO
40515   INT-GPIO3: GPIO
41516   EXP-GPIO0: GPIO
42517   EXP-GPIO1: GPIO
43518   EXP-GPIO2: GPIO
44519   EXP-GPIO3: GPIO
45520   EXP-GPIO4: GPIO
46521   EXP-GPIO5: GPIO
47522   EXP-GPIO6: GPIO
48523   EXP-GPIO7: GPIO
49~~~~~~~~~~~~~
50
51If a PCA9545 I2C switch is detected an extra four I2C busses will appear,
52representing the four downstream busses. Output from 'mraa-i2c list'
53would be as follows:
54~~~~~~~~~~~~~
55Bus 512: id=00 type=ft4222  default
56Bus 513: id=01 type=ft4222
57Bus 514: id=02 type=ft4222
58Bus 515: id=03 type=ft4222
59Bus 516: id=04 type=ft4222
60~~~~~~~~~~~~~
61
62Please note that some mraa features might not be fully implemented yet and they
63are still under development (e.g. SPI replacement functions).
64
65We tested the module using FTDI's UMFT4222EV reference board. More details on
66this board can be found
67[here](http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UMFT4222EV.pdf).
68
69Interface notes
70---------------
71
72You will need to unload all ftdi kernel modules for libft4222 to work
73correctly. You will also have to compile mraa with FT4222 support which may not
74be enabled by default.
75
76The cmake options to build this driver are:
77~~~~~~~~~~~~~
78FTDI4222=ON
79USBPLAT=ON
80~~~~~~~~~~~~~
81