racpi
Posts: 33
Joined: Mon Dec 30, 2013 11:54 am
Location: australia

pigpio callback

Tue Mar 24, 2015 12:21 am

I'm writing a python pgm to use a rfm12b or a rfm69cw module,I'm thinking I can use a callback from the rfm12b int output to trigger spi read or xfer , I'm pretty sure this is doable for rx. (especially using a rfm69 with its bigger buffer)
problem I envision is that rfm modules also generate interrupts on tx/cmd xfers too , I want to be able ignore these interrupts when needed .
question is ..... how can I enable/ disable a pigpio.callback (similar to disabling the interrupt on a pic /avr )

scotty101
Posts: 3085
Joined: Fri Jun 08, 2012 6:03 pm

Re: pigpio callback

Tue Mar 24, 2015 10:12 am

Have you tried looking at the Pigpio documentation?

http://abyz.co.uk/rpi/pigpio/python.html#callback
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

racpi
Posts: 33
Joined: Mon Dec 30, 2013 11:54 am
Location: australia

Re: pigpio callback

Tue Mar 24, 2015 11:55 am

thanks for the reply ,but it was in fact the first place I looked . I see nothing there to pause,cancel,stop or even remove a callback once initiated . unlike notify but notify has no edge control .

anewcomb
Posts: 3
Joined: Thu Dec 20, 2012 7:31 pm

Re: pigpio callback

Fri May 25, 2018 1:28 am

In case anyone else runs into this, it is clearly documented in the pi.gpio documentation pointed to above.

Code: Select all

def cbf(gpio, level, tick):
   print(gpio, level, tick)

cb1 = pi.callback(22, pigpio.EITHER_EDGE, cbf)
cb1.cancel() # To cancel callback cb1.

Return to “Python”

Who is online

Users browsing this forum: No registered users and 15 guests