en:bpi-r64:gpio
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:bpi-r64:gpio [2022/01/19 07:43] – [GPIO] frank | en:bpi-r64:gpio [2023/06/08 17:06] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== GPIO ====== | ||
+ | [[..: | ||
+ | ===== pin-define ===== | ||
+ | {{http:// | ||
+ | |||
+ | |||
+ | ^ 2nd function ^ main function ^ pin# ^ xxxxxxxxxxxxxxxxxxxxx ^ pin# ^ main function | ||
+ | | | | | {{ : | ||
+ | | | +3V3 | | ||
+ | | GPIO 56 # | I2C1_SDA | | ||
+ | | GPIO 55 # | I2C1_SCL | | ||
+ | | GPIO101 | PWM 7 | | ||
+ | | | GND | | ||
+ | | GPIO 51 # | PWM1 / UART1-TX | ||
+ | | GPIO 52 # | PWM2 / UART1-RX | 13 | ::: | 14 | GND | | | ||
+ | | GPIO 98 # | | 15 | ::: | 16 | | GPIO 61 # | | ||
+ | | | +3V3 | 17 | ::: | 18 | | GPIO 62 # | | ||
+ | | GPIO 68 # | PWM5 / SPI1 MOSI | 19 | ::: | 20 | GND | | | ||
+ | | GPIO 69 | PWM6 / SPI1 MISO | 21 | ::: | 22 | SPI0 CLK | GPIO 63 | | ||
+ | | GPIO 67 | PWM4 / SPI1 CLK | 23 | ::: | 24 | SPI1 CS | GPIO 70 | | ||
+ | | | GND | 25 | ::: | 26 | SPI0 CS | GPIO 66 | | ||
+ | | GPIO 58 | I2C2 SDA | 27 | ::: | 28 | I2C2 SCL | GPIO 57 | | ||
+ | | GPIO 85 | | 29 | ::: | 30 | GND | | | ||
+ | | GPIO 82 | SPI0 MOSI| 31 | ::: | 32 | SPI0 MOSI | GPIO 64 | | ||
+ | | | | 33 | ::: | 34 | GND | | | ||
+ | | | | 35 | ::: | 36 | SPI0 MISO | GPIO 65 | | ||
+ | | GPIO 86 | | 37 | ::: | 38 | I2S IN | | | ||
+ | | | GND | 39 | ::: | 40 | I2S OUT | | | ||
+ | | | | ::: | | | | | ||
+ | |||
+ | (# verified gpio working, 101 is blocked by pwm) | ||
+ | |||
+ | * uart0 (dts) => Debug-Uart | ||
+ | * uart1 (dts) => undefined => mt7622_uart2_2_tx_rx_pins (59/60) | ||
+ | * uart2 (dts) => uart1 (gpio) => mt7622_uart2_1_tx_rx_pins (51/52) | ||
+ | |||
+ | |||
+ | ===== Kernel 4.19 ===== | ||
+ | |||
+ | < | ||
+ | root@bpi-iot-ros-ai: | ||
+ | GPIO ranges handled: | ||
+ | 0: pinctrl_mt7622 GPIOS [409 - 511] PINS [0 - 102] | ||
+ | root@bpi-iot-ros-ai: | ||
+ | root@bpi-iot-ros-ai: | ||
+ | 465 | ||
+ | root@bpi-iot-ros-ai: | ||
+ | |||
+ | -bash: echo: write error: Invalid argument => blocked by i2c1 | ||
+ | |||
+ | #if i2c1 is disabled in dts: | ||
+ | root@bpi-r64: | ||
+ | root@bpi-r64: | ||
+ | root@bpi-r64: | ||
+ | root@bpi-r64: | ||
+ | </ | ||
+ | |||
+ | The sysfs interface (/ | ||
+ | |||
+ | ==== uart ==== | ||
+ | |||
+ | debug-Uart is uart0 in DTS, uart2 seems to be uart1 of gpio header...uart1 is currently not defined in dts. | ||
+ | |||
+ | ==== on-board LEDs ==== | ||
+ | |||
+ | needs LEDS_GPIO [=y] | ||
+ | |||
+ | there is only red and green, red seems not working | ||
+ | |||
+ | echo 1 > / | ||
+ | |||
+ | ===== pwm ===== | ||
+ | |||
+ | in linux numbering begins at 0 where on bpi documentation/ | ||
+ | |||
+ | * pwm1 pin 11 (GPIO 51) | ||
+ | * pwm2 pin 13 (GPIO 52) | ||
+ | * pwm3 fan, | ||
+ | * pwm4 pin 23 (GPIO 67) | ||
+ | * pwm5 pin 19 (GPIO 68) | ||
+ | * pwm6 pin 21 (GPIO 69) | ||
+ | * pwm7 pin7 (GPIO101) - seems not working | ||
+ | |||
+ | pwm working except 3 (2) and 7 (6) in my [[https:// | ||
+ | |||
+ | < | ||
+ | root@bpi-r64: | ||
+ | root@bpi-r64:/ | ||
+ | root@bpi-r64:/ | ||
+ | root@bpi-r64:/ | ||
+ | root@bpi-r64:/ | ||
+ | root@bpi-r64:/ | ||
+ | </ | ||
+ | ==== pwm in uboot ==== | ||
+ | |||
+ | pwm-patches from sam are merged in 2020-07, but to use them there is cmd_pwm needed | ||
+ | |||
+ | http:// | ||
+ | |||
+ | both Available in [[https:// | ||
+ | |||
+ | here pwm1 (0) is defined in dts |