Lazarus

Programming => Embedded => Operating Systems => Embedded - ARM => Topic started by: pascalbythree on April 06, 2017, 12:22:34 pm

Title: GPIO interrupt code
Post by: pascalbythree on April 06, 2017, 12:22:34 pm
Does anbode have Interrupt example code, to use for my GPIO Raspberry. To trigger some buttons. So u do not need a Timer.
Title: Re: GPIO interrupt code
Post by: bobihot on April 06, 2017, 01:10:07 pm
I so interested.
May be need to write a OS driver, or use them. And to assign a function to handle this?
Title: Re: GPIO interrupt code
Post by: Carlos Liñan on April 14, 2018, 01:13:00 pm
I am interested in this matter, but I can not find information, can anyone show an example?

Me interesa este asunto, pero no encuentro informacion, alguien puede mostrar algún ejemplo?
Title: Re: GPIO interrupt code
Post by: Tz on September 02, 2019, 09:09:32 am
if you are using linux try using epoll  :D
Title: Re: GPIO interrupt code
Post by: avra on September 02, 2019, 10:11:41 am
https://wiki.freepascal.org/Lazarus_on_Raspberry_Pi/de#Interrupt
https://github.com/SAmeis/pascalio/blob/master/examples/linux_interrupt/project1.lpr
https://github.com/SAmeis/pascalio/blob/master/gui-src/fpgpiocomp.pas
Title: Re: GPIO interrupt code
Post by: Swirl on April 30, 2020, 06:11:29 pm
Maybe it's my misunderstanding but in the examples I always see a "waiting for interrupt".
In my understanding an interrupt is something you do not have to wait(loop) for. E.g. Like a TTimer event. I would like to have a procedure that is called without including a "polling loop".
Is there a way like NMIs I used on the good old Zilog Z80.

Code: Pascal  [Select][+][-]
  1. InterruptProc(Sender: Foo);
  2. begin
  3.   dosomething;
  4. end;

Please tell me how to do that or tell me that I am misunderstanding the examples.

Regards,
Mike

Update
As I read here...
https://www.raspberrypi.org/forums/viewtopic.php?t=9207
...a "real" Interrupt would be a part of the kernel and thus it's not available on the pi.
The best way to perform an "interrupt" is a thread. This will be adequate for me.
TinyPortal © 2005-2018