diff options
| author | WillaWillNot <[email protected]> | 2025-11-20 16:24:15 -0500 |
|---|---|---|
| committer | WillaWillNot <[email protected]> | 2025-11-21 16:36:15 -0500 |
| commit | 623623a25f213f76de932eaf4458c3120823d205 (patch) | |
| tree | a1039bcdb29488180f4fe669f16ac0b33370404e /docs/pages | |
| parent | de4d7f56473df58d9b3fa8ec4917ab86550005ae (diff) | |
Updated documentation, fixed EXTI definition issues with chips that have touch sensing, updated examples, added generation of convenience method to bind_interrupts for easier type erasure
Diffstat (limited to 'docs/pages')
| -rw-r--r-- | docs/pages/faq.adoc | 6 | ||||
| -rw-r--r-- | docs/pages/layer_by_layer.adoc | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index 8098e12ac..e59ef7b46 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc | |||
| @@ -171,7 +171,11 @@ Note that the git revision should match any other embassy patches or git depende | |||
| 171 | 171 | ||
| 172 | == Can I use manual ISRs alongside Embassy? | 172 | == Can I use manual ISRs alongside Embassy? |
| 173 | 173 | ||
| 174 | Yes! This can be useful if you need to respond to an event as fast as possible, and the latency caused by the usual “ISR, wake, return from ISR, context switch to woken task” flow is too much for your application. Simply define a `#[interrupt] fn INTERRUPT_NAME() {}` handler as you would link:https://docs.rust-embedded.org/book/start/interrupts.html[in any other embedded rust project]. | 174 | Yes! This can be useful if you need to respond to an event as fast as possible, and the latency caused by the usual “ISR, wake, return from ISR, context switch to woken task” flow is too much for your application. |
| 175 | |||
| 176 | You may simply define a `#[interrupt] fn INTERRUPT_NAME() {}` handler as you would link:https://docs.rust-embedded.org/book/start/interrupts.html[in any other embedded rust project]. | ||
| 177 | |||
| 178 | Or you may define a struct implementing the `embassy-[family]::interrupt::typelevel::Handler` trait with an on_interrupt() method, and bind it to the interrupt vector via the `bind_interrupts!` macro, which introduces only a single indirection. This allows the mixing of manual ISRs with Embassy driver-defined ISRs; handlers will be called directly in the order they appear in the macro. | ||
| 175 | 179 | ||
| 176 | == How can I measure resource usage (CPU, RAM, etc.)? | 180 | == How can I measure resource usage (CPU, RAM, etc.)? |
| 177 | 181 | ||
diff --git a/docs/pages/layer_by_layer.adoc b/docs/pages/layer_by_layer.adoc index 0692ee4fa..f554e642a 100644 --- a/docs/pages/layer_by_layer.adoc +++ b/docs/pages/layer_by_layer.adoc | |||
| @@ -76,7 +76,7 @@ The async version looks very similar to the HAL version, apart from a few minor | |||
| 76 | * The peripheral initialization is done by the main macro, and is handed to the main task. | 76 | * The peripheral initialization is done by the main macro, and is handed to the main task. |
| 77 | * Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low). | 77 | * Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low). |
| 78 | 78 | ||
| 79 | When `button.wait_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiInput`), so that whenever an interrupt is raised, the task awaiting the button will be woken up. | 79 | When `button.wait_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. On this chip, interrupt signals on EXTI lines 10-15 (including the button on EXTI line 13) raise the hardware interrupt EXTI15_10. This interrupt handler has been bound (using `bind_interrupts!`) to call the `InterruptHandler` provided by the exti module, so that whenever an interrupt is raised, the task awaiting the button via `wait_for_any_edge()` will be woken up. |
| 80 | 80 | ||
| 81 | The minimal overhead of the executor and the ability to run multiple tasks "concurrently" combined with the enormous simplification of the application, makes `async` a great fit for embedded. | 81 | The minimal overhead of the executor and the ability to run multiple tasks "concurrently" combined with the enormous simplification of the application, makes `async` a great fit for embedded. |
| 82 | 82 | ||
