I am using rPi with the current wheezy image.
To access the GPIOs (c program) I am using the bcm2835 lib from Mike McCauley.
Today I tried the event example and found out, that the if condition never was true.
Code: Select all
// Set RPI pin P1-15 to be an input
bcm2835_gpio_fsel(PIN, BCM2835_GPIO_FSEL_INPT);
// with a pullup
bcm2835_gpio_set_pud(PIN, BCM2835_GPIO_PUD_UP);
// And a low detect enable
bcm2835_gpio_len(PIN);
while (1)
{
if (bcm2835_gpio_eds(PIN))
{
// Now clear the eds flag by setting it to 1
bcm2835_gpio_set_eds(PIN);
printf("low event detect for pin 15\n");
}
// wait a bit
delay(500);
}In the forum I found a similar problem with an explanation, that this could be a CPU interrupt problem.
I have had a look at the datasheet and disbled the GPIO interrupts and now it works.
Does anybody know if the rPi needs the interrupt (gpio_int[0] #52) for any other things?
The datasheet is not really precise in the explanation of the GPIO interrupts.
Can anybody explain the interrupt function?
Thank you in advance.
Stephan