uboot get button state

main
Links 2022-04-07 21:07:57 +02:00
rodzic 75ded4b75f
commit f9b6f5f590
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 68FB9F01C0C482FC
1 zmienionych plików z 26 dodań i 1 usunięć

Wyświetl plik

@ -123,4 +123,29 @@ Using ssh or serial:
dtc -I dtb -O dts sun8i-r16-x6100.dtb > sun8i-r16-x6100.dts
dtc -I dts -O dtb sun8i-r16-x6100.dts > sun8i-r16-x6100.dtb
```
```
# uboot
## get button state
this code checks the buttons below the screen.
number 1 is the left most.
```sh
#set matrix row
gpio clear PG6
if gpio input PE16 ; then
echo 1
elif gpio input PE17 ; then
echo 2
elif gpio input PE11 ; then
echo 3
else
echo none
fi
#reset matrix
gpio input PG6
```