|
avr_irq_t * | avr_alloc_irq (avr_irq_pool_t *pool, uint32_t base, uint32_t count, const char **names) |
| Allocates 'count' IRQs, initializes their "irq" starting from 'base' and increment. More...
|
|
void | avr_free_irq (avr_irq_t *irq, uint32_t count) |
| Free allocated IRQs. More...
|
|
void | avr_init_irq (avr_irq_pool_t *pool, avr_irq_t *irq, uint32_t base, uint32_t count, const char **names) |
| Init 'count' IRQs, initializes their "irq" starting from 'base' and increment. More...
|
|
void | avr_raise_irq (avr_irq_t *irq, uint32_t value) |
| Raise an IRQ. I.e. call their 'hooks', and raise any chained IRQs, and set the new 'value'. More...
|
|
void | avr_connect_irq (avr_irq_t *src, avr_irq_t *dst) |
| Connect a source IRQ to a destination IRQ. More...
|
|
void | avr_unconnect_irq (avr_irq_t *src, avr_irq_t *dst) |
| Disconnect a source IRQ to a destination IRQ. More...
|
|
void | avr_irq_register_notify (avr_irq_t *irq, avr_irq_notify_t notify, void *param) |
| Register a notification hook (callback) for an irq. More...
|
|
void | avr_irq_unregister_notify (avr_irq_t *irq, avr_irq_notify_t notify, void *param) |
| Unregister a callback for an irq. More...
|
|
- Note
- IRQ stands usually for Interrupt Request, but here it has nothing to do with AVR interrupts. It is in fact a messaging system bewteen the simulator and the user code, similar to the Qt signal-slot architecture. "Raise" means "emit" in Qt language.
This subsystem allows any piece of code to "register" a hook to be called when an IRQ is raised. The IRQ definition is up to the module defining it, for example a IOPORT pin change might be an IRQ in which case any piece of code can be notified when a pin has changed state
The notify hooks are chained, and duplicates are filtered out so you can't register a notify hook twice on one particular IRQ
IRQ calling order is not defined, so don't rely on it.
IRQ hook needs to be registered in reset() handlers, i.e. after all modules init() bits have been called, to prevent race condition of the initialization order.
typedef void(* avr_irq_notify_t) (struct avr_irq_t *irq, uint32_t value, void *param) |
Callback Prototype.
- Parameters
-
irq | is the caller |
value | is the raised value |
param | is the user data provided at the IRQ registration |
Enumerator |
---|
IRQ_FLAG_NOT |
change polarity of the IRQ
|
IRQ_FLAG_FILTERED |
do not "notify" if "value" is the same as previous raise
|
IRQ_FLAG_ALLOC |
this irq structure was malloced via avr_alloc_irq
|
IRQ_FLAG_INIT |
this irq hasn't been used yet
|
Allocates 'count' IRQs, initializes their "irq" starting from 'base' and increment.
Connect a source IRQ to a destination IRQ.
void avr_free_irq |
( |
avr_irq_t * |
irq, |
|
|
uint32_t |
count |
|
) |
| |
Init 'count' IRQs, initializes their "irq" starting from 'base' and increment.
Register a notification hook (callback) for an irq.
- Parameters
-
param | is anything that your want passed back as argument |
Unregister a callback for an irq.
void avr_raise_irq |
( |
avr_irq_t * |
irq, |
|
|
uint32_t |
value |
|
) |
| |
Raise an IRQ. I.e. call their 'hooks', and raise any chained IRQs, and set the new 'value'.
Disconnect a source IRQ to a destination IRQ.