.. raw:: html .. role:: red .. role:: green .. role:: blue .. role:: pink .. role:: black .. include:: /keyword.rst ================ |G520-G720-EVK| ================ .. contents:: Sections :local: :depth: 1 .. _i2c-g720-evk: I2C --- There are 9 I2C adapters on |G520-G720-EVK|: - I2C-0 shared with `Raspberry Pi HAT`_ - I2C-1 shared with `Raspberry Pi HAT`_ - I2C-2 shared with Current Monitor - I2C-3 shared with NA - I2C-4 shared with Charger IC, Buck IC - I2C-5 shared with PD Controller - I2C-6 shared with Touch, SBU MUX - I2C-7 shared with CAM0 - I2C-8 shared with CAM1 .. _spi-g720-evk: SPI --- There are 2 master SPI devices on |G520-G720-EVK|: - SPI-0 shared with CAN bus MCP2518 - SPI-1 on `Raspberry Pi HAT`_ Pin #19(MOSI) #21(MISO) #23(SCLK) #24(CS) .. _pwm-720-evk: PWM --- There are 3 general PWM devices on |G520-G720-EVK|, but only two PWM pin are exported out: - PWM_1 on `Raspberry Pi HAT`_ Pin #32 - PWM_2 on `Raspberry Pi HAT`_ Pin #33 .. note:: By default, PWM_1 and PWM_2 are inactive. You have to set pinmux to enable them. And also need to power on the raspi pin via setting GPIO81 as output-high. You can use ``sysfs`` to operate PWM devices. First, you need to export the PWM node. .. prompt:: bash # auto # echo 1 > /sys/class/pwm/pwmchip0/export Second, you need to set the period and the duty cycle. .. prompt:: bash # auto # echo 2000000 > /sys/class/pwm/pwmchip0/pwm1/period # echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle Finally, you can enable the PWM device. .. prompt:: bash # auto # echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable You can also use the kernel `debugfs` to check the value of PMW devices. .. prompt:: bash # auto # cat /sys/kernel/debug/pwm platform/11008000.pwm, 3 PWM devices pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal pwm-1 (sysfs ): requested enabled period: 2000000 ns duty: 1000000 ns polarity: normal pwm-2 ((null) ): period: 0 ns duty: 0 ns polarity: normal .. _uart-g720-evk: UART ---- There are 4 UART devices on |G520-G720-EVK|. The supported baud is from 300 bps to 3000000 bps: - UART0: Connect to USB bridge(`FT232RL`), USB Type-C UART0 connector - UART1: Connect to USB bridge(`FT232RL`), USB Type-C UART1 connector - UART2: Shared with pin header(J477) and `Raspberry Pi HAT`_ + J470/J471/J514/J515 pin1,pin2 short: Pin Header(J477) + J470/J471/J514/J515 pin2,pin3 short: `Raspberry Pi HAT`_ Pin #8(Tx) #10(Rx) #11(RTS) #36(CTS) - UART3: Connect to pin header(J490) .. table:: pin definition of UART2 Pin Header(J477) ======= =================== Pin # Pin source ======= =================== 1 :black:`GND` 2 :green:`UART2_RTS` 3 :red:`UART2_VIO` 4 :green:`UART2_RXD` 5 :green:`UART2_TXD` 6 :green:`UART2_CTS` ======= =================== .. table:: pin definition of UART3 Pin Header(J490) ======= =================== Pin # Pin source ======= =================== 1 :black:`GND` 2 :green:`UART3_RTS` 3 :red:`UART3_VIO` 4 :green:`UART3_RXD` 5 :green:`UART3_TXD` 6 :green:`UART3_CTS` ======= =================== .. note:: UART0 is used for AP debug console .. _gpio-g720-evk: GPIO ---- The SoC features a total of 182 GPIO pins. However, due to the limitation on the number of physical pins, only a subset of GPIO pins are available for use. The actual positions of the available GPIO pins are shown in `Raspberry Pi HAT`_. You can use the kernel debugfs to check the status of the GPIO devices. .. prompt:: bash # auto # cat /sys/kernel/debug/pinctrl/10005000.pinctrl-pinctrl_paris/pins pin 0 (GPIO0) 0:pinctrl_paris 000: 0000011110 pin 1 (GPIO1) 1:pinctrl_paris 001: 0000011110 pin 2 (GPIO2) 2:pinctrl_paris 002: 0000011111 pin 3 (GPIO3) 3:pinctrl_paris 003: 0001011110 pin 4 (GPIO4) 4:pinctrl_paris 004: 0000011110 pin 5 (GPIO5) 5:pinctrl_paris 005: 0000011110 The format of the dump result is as follows: .. prompt:: bash # auto (MODE) (DIR) (DOUT) (DIN) (DRIVE) (SMT) (IES) (PULL_EN) (PULL_SEL) (R1 R0 or RSEL) .. list-table:: Pin Status Dump Information :header-rows: 1 :widths: 18 68 * - Item - Description * - MODE - Current GPIO multiplexer mode * - DIR - Pin direction (0: input; 1: output) * - DOUT - Current output value. Valid when DIR=1. (0: low; 1: high) * - DIN - Current input value (0: low; 1: high) * - DRIVE - 2 bits indicating the pin’s driving strength * - SMT - Schmitt trigger function status (0: disabled; 1: enabled) * - IES - Input function status (0: disabled; 1: enabled) * - PULL_EN - Pull function status (0: disabled; 1: enabled) * - PULL_SEL - Current pull direction (only valid when PULL_EN=1). (0: pull down; 1: pull up) * - R1 R0 or RSEL - Pull resistor selection (Some pins can select the pull resistor value) .. _pin-header-g720-evk: Raspberry Pi HAT ---------------------- There is a 40-pin Raspberry Pi HAT on |G520-G720-EVK|. It contains several peripheral interfaces. By default, it follows the official Raspberry Pi setting. For more details about RPi HAT, please refer to `GPIO and the 40-pin Header `_. You can use the header to connect your external devices. .. table:: pin definition of Raspberry Pi HAT ===== ================== ===== =================== Pin # Main Pin # Main ===== ================== ===== =================== 1 :red:`VDD_3V3` 2 :red:`VDD_5V` 3 :green:`I2C1_SDA` 4 :red:`VDD_5V` 5 :green:`I2C1_SCL` 6 :black:`GND` 7 :pink:`GPIO107` 8 :pink:`UART2_TXD` 9 :black:`GND` 10 :pink:`UART2_RXD` 11 :pink:`UART2_RTS` 12 :pink:`PCM_CLK` 13 :pink:`GPIO108` 14 :black:`GND` 15 :pink:`GPIO109` 16 :pink:`GPIO110` 17 :red:`VDD_3V3` 18 :pink:`GPIO42` 19 :pink:`SPI1_MOSI` 20 :black:`GND` 21 :pink:`SPI1_MISO` 22 :pink:`GPIO106` 23 :pink:`SPI1_SCLK` 24 :pink:`SPI1_CS` 25 :black:`GND` 26 :pink:`GPIO85` 27 :green:`I2C0_SDA` 28 :green:`I2C0_SCL` 29 :pink:`GPIO104` 30 :black:`GND` 31 :pink:`GPIO105` 32 :green:`PWM0` 33 :green:`PWM1` 34 :black:`GND` 35 :pink:`PCM_SYNC` 36 :pink:`UART2_CTS` 37 :pink:`GPIO103` 38 :pink:`PCM_DI` 39 :black:`GND` 40 :pink:`PCM_DO` ===== ================== ===== =================== .. note:: 1. VDD_5V power can provide 5V/2A maximum but share with USB Host VBUS 5V output. 2. VGPIOEXT_3V3 power can deliver 3.3V/300mA 3. :black:`Black` words are ground pins. 4. :red:`Red` words are power pins. 5. :green:`Green` words are special function pins. 6. :blue:`Blue` words are GPIOs. 7. :pink:`Pink` words are pins, which are default used by other modules. Please refer to :ref:`function-select-table` for more detailed information. .. warning:: The default input/output voltage of the GPIO pins on the header is **3.3V**. Before using them, please make sure the voltage is suitable for your external device. Otherwise, the unmatched voltage may destroy both |G520-G720-EVK| and external devices. On the |G520-G720-EVK|, there are several jumpers used to select the pinout of Raspberry Pi HAT pins. To select the function, please short the pins according to the table below: .. _function-select-table: .. table:: function select of Raspberry Pi HAT jumper ======== ============== ================== ================ Jumper # Pin source 1-2 2-3 ======== ============== ================== ================ J470 `UART2_RXD` `Pin Header(J477)` `RasPi Header #10` J471 `UART2_TXD` `Pin Header(J477)` `RasPi Header #8` J514 `UART2_CTS` `Pin Header(J477)` `RasPi Header #36` J515 `UART2_RTS` `Pin Header(J477)` `RasPi Header #11` J474 `BT_RST` `WIFI_BT_RST_R` `RasPi Header #26` J475 `I2SOUT0_BCK` `EDP_BL_EN_1V8` `RasPi Header #13` J476 `I2SOUT0_LRCK` `EDP_3V3_EN` `RasPi Header #15` J478 `I2SIN0_MCK` `I2SIN0_MCK_T` `RasPi Header #37` J479 `I2SIN0_BCK` `I2SIN0_BCK_T` `RasPi Header #29` J480 `I2SIN0_LRCK` `I2SIN0_LRCK_T` `RasPi Header #31` J481 `PCM_SYNC` `MT7921_PCM_SYNC` `RasPi Header #35` J482 `PCM_CLK` `MT7921_PCM_CLK` `RasPi Header #12` J483 `I2SOUT0_DO` `EDP_12V_EN` `RasPi Header #16` J484 `JTDO` `DBG1_TDO` `RasPi Header #18` J485 `I2SIN0_DI` `I2SIN0_DI_T` `RasPi Header #22` J487 `PCM_DI` `MT7921_PCM_DI` `RasPi Header #38` J488 `PCM_DO` `MT7921_PCM_DO` `RasPi Header #40` J502 `SPIM1_MOSI` `WCN_3V3_EN` `RasPi Header #19` J503 `SPIM1_MISO` `CAN_INT_GPIO` `RasPi Header #21` J504 `SPIM1_CLK` `CMMPDN0` `RasPi Header #23` J505 `SPIM1_CSB` `CMMPDN1` `RasPi Header #24` J506 `I2SOUT0_MCK` `CSR_EN_GPIO107` `RasPi Header #5` ======== ============== ================== ================