Peripheral¶
Pinmux¶
List pin groups:
mt7688_pinmux get
Reassign pin group:
mt7688_pinmux set <group> <function>
SPI over GPIO¶
Install SPI-GPIO drivers:
# opkg update # opkg install kmod-spi-gpio # opkg install kmod-spi-dev # opkg install kmod-spi-gpio-custom
Use mt7688_pinmux to make sure devoted pins are in GPIO state. Probably, reboot needed ???
Insert the module:
insmod spi-gpio-custom bus<x=0...3>=<id>,<sck>,<mosi>,<miso>,<mode1>,<maxfreq1>,<cs1>
E.g.:
insmod spi-gpio-custom bus0=1,14,15,16,0,10000,17
Modes:
| Mode# | CPOL | CPHA |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 1 |
| 2 | 1 | 0 |
| 3 | 1 | 1 |