Interrupt on GPIO-Pin in Qt

Ozzy
Hi,

I want to integrate a rotary knob in my system. This knob has 2 channels.
When rotating clockwise, first channel A and than B changes from low to
high. When rotating ccw, first channel B and than channel A changes from
low to high.
My idea was to connect one channel to a GPIO that generates an interrupt
and than read the second channel from a second GPIO.

My questions are now: is this possible on Mini210s without recompiling the
kernel? How can I get this result in to my Qt program?

Thanks and best regards
Ozzy

Juergen
You have to re-compile the kernel in any case if you want to use new
interrupt features.
And the kernel already comes with such kind of "Rotary encoders connected
to GPIO pins" driver.

Ozzy
Hi Juergen,

thanks for your fast reply. Is there any instruction how to re-compile the
kernel (this is my first time) for Mini210s and where I can get the
sources?

Thanks and best regards
Ozzy

Juergen
> Is there any instruction how to re-compile the kernel [...] for Mini210s

Don't know. At least not from my side :) Didn't you receive a CD with the
sources?

Srikanth
Hi Ozzy,

First find the make file in the kernel tree as " mk" file.

If it is found then open it with vim mk file, then find the kernel option ,
Most of the times 1. mk -k for alone kernel.
                  2. mk -a for complete source tree.

now, come out of the file, then compile it with 
1    ./mk -k for alone kernel.
2    ./mk -a for complete source.

Thanks,
Srikanth.

Ozzy
Hi,

thanks for your response. I'll try to compile the kernel on the weekend.
But my second question is: how do I get the interrupt in my Qt program?

Thanks and best regards
Ozzy

Ozzy
Hi,

I still have absolutely no idea how to integrate this rotary encoder into
the kernel. 
Has anyone done this before and can help me?

Thanks and best regards
Ozzy

Sandeep Sondagar
Dear Ozzy,

I have used FriendlyArm's GPIO connector and able to integrate it in my Qt
application.

Use "QSocketNotifier" on /sys/class/gpioxxx/value.

Sandeep Sondagar
For Interrupt, write "both" to edge file. and use "QSocketNotifier" on
"/sys/class/gpio/gpioxxx/uevent"

Juergen
A driver for a rotary encoder connected to GPIO pins is part of the kernel
for ages. You just have to define the GPIOs your rotary encoder is
connected to and the characters/events this driver should use and create if
someone rotates the knob.
You shouldn't re-invent the wheel again and again.

Sandeep Sondagar
Hi Juergen,

I know that and rotary encoder has nice document. Unfortunately i was
unable to get if functioned.

I will give it another try.