There are helper methods created in the irq module. Which is accessible on the main avr object.
Currently helpers are only created for digital IO and ADC. But all the required IRQ methods/macros I found are already exposed on the swig level in the utils.i.
For example to register a callback on pin change:
This enables both-way communication between Python and simavr core. No need to create custom parts in C anymore just to be able to watch pin change etc.
Coverage increased (+3.7%) to 82.261% when pulling a3f031b65f818c37246ec006aac889c95acd74e8 on Premik:IRQCallback into a04237dd37e143d0a80f883c472093dd9dd70d25 on ponty:master.
Coverage increased (+3.7%) to 82.31% when pulling 2fb7d8a2f12569d9c499ef85662be837656b3fc3 on Premik:IRQCallback into a04237dd37e143d0a80f883c472093dd9dd70d25 on ponty:master.
Coverage increased (+3.7%) to 82.31% when pulling 2fb7d8a2f12569d9c499ef85662be837656b3fc3 on Premik:IRQCallback into a04237dd37e143d0a80f883c472093dd9dd70d25 on ponty:master.
Coverage increased (+3.7%) to 82.31% when pulling 2fb7d8a2f12569d9c499ef85662be837656b3fc3 on Premik:IRQCallback into a04237dd37e143d0a80f883c472093dd9dd70d25 on ponty:master.
Coverage increased (+3.7%) to 82.31% when pulling a2cc8f620fc78dac7dcce0aca296699b505e89c4 on Premik:IRQCallback into a04237dd37e143d0a80f883c472093dd9dd70d25 on ponty:master.
Coverage increased (+3.7%) to 82.31% when pulling a2cc8f620fc78dac7dcce0aca296699b505e89c4 on Premik:IRQCallback into a04237dd37e143d0a80f883c472093dd9dd70d25 on ponty:master.
Coverage increased (+3.7%) to 82.31% when pulling a2cc8f620fc78dac7dcce0aca296699b505e89c4 on Premik:IRQCallback into a04237dd37e143d0a80f883c472093dd9dd70d25 on ponty:master.
The callback implemeted also the IRQ stuff.
irq
module. Which is accessible on the mainavr
object.More comperhensive usage is in the
test_irq.py
.This enables both-way communication between Python and simavr core. No need to create custom parts in C anymore just to be able to watch pin change etc.