Jump to content
  • 0

zybo zy-10 PS button press detection



Trying to detect PS MIO mapped button btn4 (mio 50, pin B13) and btn5 (mio51, pin B9) via sysfs reads. Built petalinux images from the digilent bsp for 2022.1 tools.

The auto-generate dts for the gpio controller for this bsp is:

gpio@e000a000 {
compatible = "xlnx,zynq-gpio-1.0";
#gpio-cells = <0x02>;
clocks = <0x01 0x2a>;
#interrupt-cells = <0x02>;
interrupt-parent = <0x04>;
interrupts = <0x00 0x14 0x04>;
reg = <0xe000a000 0x1000>;
emio-gpio-width = <0x40>;
gpio-mask-high = <0x00>;
gpio-mask-low = <0x5600>;
phandle = <0x0a>;

My test for the mio button detection is to configure the pins in /sus/class/gpio as follows, press and hold the button and performs reads.

root@Petalinux-2022:/sys/class/gpio# cat gpiochip905/
base       device/    label      ngpio      power/     subsystem/ uevent     
root@Petalinux-2022:/sys/class/gpio# cat gpiochip905/label 
root@Petalinux-2022:/sys/class/gpio# cat gpiochip905/ngpio 
root@Petalinux-2022:/sys/class/gpio# cat gpiochip905/base 
root@Petalinux-2022:/sys/class/gpio# echo 955 > /sys/class/gpio/export
root@Petalinux-2022:/sys/class/gpio# echo 956 > /sys/class/gpio/export                                     
root@Petalinux-2022:/sys/class/gpio# echo in > /sys/class/gpio/gpio955/direction 
root@Petalinux-2022:/sys/class/gpio# echo in > /sys/class/gpio/gpio956/direction                        
root@Petalinux-2022:/sys/class/gpio# cat /sys/class/gpio/gpio956/value                                  
root@Petalinux-2022:/sys/class/gpio# cat /sys/class/gpio/gpio956/value 
root@Petalinux-2022:/sys/class/gpio# cat /sys/class/gpio/gpio956/value 

Note I am always detecting a 1 value for both buttons in both pressed and released state. Am I missing something in the configuration?

I am able to toggle the PS LED output on mio7 using similar tests.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...