We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was trying to configure an input pin to trigger an interrupt. Following the example, I set up the pin and the gpiote.
let drdy_pin = port0.p0_30.into_floating_input().degrade(); let gpiote = Gpiote::new(device.GPIOTE); gpiote.channel0().input_pin(&drdy_pin).hi_to_lo().enable_interrupt();
However, the interrupt never triggers.
Looking at the source code, the problems seems to be that the pin number is written to the intenset and intenclr registers.
intenset
intenclr
pub fn enable_interrupt(&self) -> &Self { unsafe { self.gpiote .intenset .modify(|r, w| w.bits(r.bits() | self.pin.pin() as u32)) } self }
According to the Nordic documentation the register has a bit field for the channels. Therefore, it should be more like:
pub fn enable_interrupt(&self) -> &Self { unsafe { self.gpiote .intenset .modify(|r, w| w.bits(r.bits() | 1 << self.channel as u32)) } self }
Same goes for disabling the interrupt. I'll test later and prepare a PR. Feel free to assign the issue to me.
The text was updated successfully, but these errors were encountered:
965cc34
Merge pull request #278 from hannes-hochreiner/master
2755bf3
Fix #277 (re)setting GPIOTE interrupts for channels
No branches or pull requests
I was trying to configure an input pin to trigger an interrupt. Following the example, I set up the pin and the gpiote.
However, the interrupt never triggers.
Looking at the source code, the problems seems to be that the pin number is written to the
intenset
andintenclr
registers.According to the Nordic documentation the register has a bit field for the channels. Therefore, it should be more like:
Same goes for disabling the interrupt.
I'll test later and prepare a PR. Feel free to assign the issue to me.
The text was updated successfully, but these errors were encountered: