BL4S200 User’s Manual
104
4.4.4 Rabbit RIO Interrupt Handlers
addISR
int addISR(int channel, int io, int ier, void (*handler)());
FUNCTION DESCRIPTION
Adds an interrupt handler for the interrupts specified in the
ier
parameter for the given
RIO block hosting the given configurable I/O pin. The interrupt service routine (ISR) is
always disabled when created. Call
enableISR()
to enable the interrupt service
routine. The ISR handler function is responsible for clearing the interrupt(s) within the
hosting RIO block when called.
PARAMETERS
channel
configurable I/O channel to bind to ISR, 0–31
io
BL_INPUT_BLOCK
for input block
BL_OUTPUT_BLOCK
for output block
ier
bit mask of interrupt(s) this handler services
BL_IER_DQE
— decrement/quadrature/end
BL_IER_IIB
— increment/inphase/begin
BL_IER_ROLL_D
— counter rollover on decrement
BL_IER_ROLL_I
— counter rollover on increment
BL_IER_MATCH3
— Match 3 condition
BL_IER_MATCH2
— Match 2 condition
BL_IER_MATCH1
— Match 1 condition
BL_IER_MATCH0
— Match 0 condition
handler
pointer to the interrupt service function
RETURN VALUE
Success — returns the handler ID number (
0..RSB_MAX_ISR-1
).
-EINVAL
— Invalid parameter given.
-ENOSPC
— No more room in ISR table (increase
RSB_MAX_ISR
).
SEE ALSO
addISR_H, tickISR, enableISR, setIER