Alan Adams
2019-09-27 11:49:56 UTC
Hi
Does anyone here understand the documentation for the GPIO module? I'm
completely confused. There was a module (pre 2017 it seems) with a host of
SWIs which were more or less descriptive. The replacement seems to only
have about ten SWIs and I can't make out from the only documentation (a
StrongHelp file) which ones would do what I need.
On an rpi, I need to enable two pins as inputs, causing an interrupt.
(Using a change of state event will not be fast enough, as that has to be
polled for).
I need to create a small module which will react to the interrupt, decide
which pin it was, and store the current clock time, then change a
pollword. (I'm assuming here that servicing an interrupt requires a
module.)
I have the hardware manual, so I know the hardware is capable of this.
What I can't see is how the GPIO module helps. Maybe it doesn't... Ideally
it would already be capable of handling the interrupt for me, but I have
doubts about that.
This is likely to be a learning experience for me, as I've never written
any C. At the monment I'm thinking it would be easier for me to write it
in assembler, especially as I have a module to use as an example - the
Socketwatch module is also in assembler. I have in the past written
assembler for VAX, Z80 and 6502. The Z80 was a language ROM providing a
complete terminal emulator, including enlarged buffers hooked into the
vectors, so not exactly trivial.
Does anyone here understand the documentation for the GPIO module? I'm
completely confused. There was a module (pre 2017 it seems) with a host of
SWIs which were more or less descriptive. The replacement seems to only
have about ten SWIs and I can't make out from the only documentation (a
StrongHelp file) which ones would do what I need.
On an rpi, I need to enable two pins as inputs, causing an interrupt.
(Using a change of state event will not be fast enough, as that has to be
polled for).
I need to create a small module which will react to the interrupt, decide
which pin it was, and store the current clock time, then change a
pollword. (I'm assuming here that servicing an interrupt requires a
module.)
I have the hardware manual, so I know the hardware is capable of this.
What I can't see is how the GPIO module helps. Maybe it doesn't... Ideally
it would already be capable of handling the interrupt for me, but I have
doubts about that.
This is likely to be a learning experience for me, as I've never written
any C. At the monment I'm thinking it would be easier for me to write it
in assembler, especially as I have a module to use as an example - the
Socketwatch module is also in assembler. I have in the past written
assembler for VAX, Z80 and 6502. The Z80 was a language ROM providing a
complete terminal emulator, including enlarged buffers hooked into the
vectors, so not exactly trivial.
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/