.intnum Property
Function: |
Sets/returns the number of the currently selected interrupt line. |
Type: |
Enum (pl_int_num, byte) |
Value Range: |
See the list of pl_int_num constants in the platform specifications. |
See Also: |
Details
Before you can configure an I/O line to serve as an interrupt, you must first select it via the io.num property. Only after you have done this can you configure the I/O line as an interrupt via the io.intnum property.
For example:
io.num = PL_IO_NUM_11; // Set the I/O line to 11
io.enabled = NO; // Set the I/O line as an input
io.intnum = PL_INT_NUM_7; // Set the interrupt number to 7
io.intedge = INT_EDGE_BOTH; // Set the interrupt edge to BOTH
io.intenabled = YES; // Enable the interrupt
You can specify on which edge interrupts are generated via io.intedge. This property has a default value of 3 — BOTH in order to ensure backwards compatibility with applications developed for TiOS-based devices.
The selected interrupt line can be enabled or disabled using the io.intenabled property. A state change on enabled interrupt lines causes the on_io_int and on_io_int_line events to be generated.
Exception Safety
There are a few situations in which an exception may be thrown when getting or setting this property. For more information, see Handling Exceptions.
Getting the Property | |
Exception |
Root Cause(s) |
std::invalid_argument |
The selected interrupt line number is invalid. |
Setting the Property | |
Exception |
Root Cause(s) |
std::invalid_argument |
|