opto_pic_init
int opto_pic_init (
int fd,
unsigned char* ltim
);
|
Description
Initializes the on-board interrupt controller PIC 8259. Calling this function
basically changes the way interrupts are triggered. The interrupts will be teporarily
disabled during the call and reenabled again when the call completes.
Parameters
This function accepts the following parameters:
- fd
is the device file descriptor obtained through the open(2) call.
-
ltim
is a pointer to an unsigned char which contains the LTIM (Level Trigger Mode).
This value controls which kind of signal makes the PIC
generate an interrupt. It can have one of the following values:
- OPTO_LTIM_HIGH:
Trigger the interrupt on high level.
- OPTO_LTIM_FLANK:
Trigger the interrupt on either a negative pulse (typically > 100ns),
or a raising flank followed by a high level.
Return Values
On success, the function will return 0. On failure, it will return
a non-null value, which is one of standard error codes.