https://github.com/pyaillet/esp-idf-isr
https://github.com/pyaillet/esp-idf-isr
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/pyaillet/esp-idf-isr
- Owner: pyaillet
- License: mit
- Created: 2022-03-07T20:05:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-09T06:18:57.000Z (over 4 years ago)
- Last Synced: 2025-02-04T19:14:34.482Z (over 1 year ago)
- Language: Rust
- Size: 9.77 KB
- Stars: 0
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esp-idf-isr
A minimal implementation of a trait allowing to subscribe to interrupts on GPIO Pin of the ESP32.
## Example usage
```rust
let (mut eventloop, _subscription) = init_eventloop().unwrap();
let peripherals = Peripherals::take().unwrap();
let mut interrupt_pin = peripherals.pins.gpio0
.into_input().unwrap()
.into_pull_up().unwrap();
interrupt_pin.configure_interrupt(InterruptType::NegEdge).unwrap();
let _subscription = unsafe {
interrupt_pin.subscribe(move || {
eventloop.post(&event::EventLoopMessage::new(1), None).unwrap();
})?
};
```