/*
* Internal IRQ system
*
- * This subsystem allow any piece of code to "register" a hook to be called when an IRQ is
+ * 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
*
IRQ_FLAG_NOT = (1 << 0), //!< change polarity of the IRQ
IRQ_FLAG_FILTERED = (1 << 1), //!< do not "notify" if "value" is the same as previous raise
IRQ_FLAG_ALLOC = (1 << 2), //!< this irq structure was malloced via avr_alloc_irq
+ IRQ_FLAG_INIT = (1 << 3), //!< this irq hasn't been used yet
};
/*
*/
typedef struct avr_irq_pool_t {
int count; //!< number of irqs living in the pool
- struct avr_irq_t ** irq; //!< irqs belongging in this pool
+ struct avr_irq_t ** irq; //!< irqs belonging in this pool
} avr_irq_pool_t;
/*!
avr_connect_irq(
avr_irq_t * src,
avr_irq_t * dst);
+void
+avr_unconnect_irq(
+ avr_irq_t * src,
+ avr_irq_t * dst);
+
//! register a notification 'hook' for 'irq' -- 'param' is anything that your want passed back as argument
void
avr_irq_register_notify(
avr_irq_notify_t notify,
void * param);
+void
+avr_irq_unregister_notify(
+ avr_irq_t * irq,
+ avr_irq_notify_t notify,
+ void * param);
+
#ifdef __cplusplus
};
#endif