.TH ose_erl_driver 3erl "ose 1.0.1" "Ericsson AB" "C Library Functions" .SH NAME ose_erl_driver \- Linked-in drivers in Enea OSE .SH DESCRIPTION .LP Writing Linked-in drivers that also work on Enea OSE is very similar for how you would do it for Unix\&. The difference from Unix is that driver_select, ready_input and ready_output all work with signals instead of file descriptors\&. This means that the driver_select is used to specify which type of signal should trigger calls to ready_input/ready_output\&. The functions described below are available to driver programmers on Enea OSE to facilitate this\&. .SH "DATA TYPES" .RS 2 .TP 2 .B union SIGNAL: See the Enea OSE SPI documentation for a description\&. .TP 2 .B SIGSELECT: See the Enea OSE SPI documentation for a description\&. .TP 2 .B ErlDrvEvent: The \fIErlDrvEvent\fR\& is a handle to a signal number and id combination\&. It is passed to \fBdriver_select(3erl)\fR\&\&. .TP 2 .B ErlDrvOseEventId: This is the id used to associate a specific signal to a certain driver instance\&. .RE .SH EXPORTS .LP .B union SIGNAL *erl_drv_ose_get_signal(ErlDrvEvent drv_event) .br .RS .LP Fetch the next signal associated with \fIdrv_event\fR\&\&. Signals will be returned in the order which they were received and when no more signals are available \fINULL\fR\& will be returned\&. Use this function in the ready_input/ready_output callbacks to get signals\&. .RE .LP .B ErlDrvEvent erl_drv_ose_event_alloc(SIGSELECT signo, ErlDrvOseEventId id, ErlDrvOseEventId (*resolve_signal)(union SIGNAL* sig), void *extra) .br .RS .LP Create a new \fIErlDrvEvent\fR\& associated with \fIsigno\fR\&, \fIid\fR\& and uses the \fIresolve_signal\fR\& function to extract the \fIid\fR\& from a signal with \fIsigno\fR\&\&. The \fIextra\fR\& parameter can be used for additional data\&. See \fB Signals in a Linked-in driver\fR\& in the OSE User\&'s Guide\&. .RE .LP .B void erl_drv_ose_event_free(ErlDrvEvent drv_event) .br .RS .LP Free a \fIErlDrvEvent\fR\&\&. This should always be done in the \fBstop_select\fR\& callback when the event is no longer being used\&. .RE .LP .B void erl_drv_ose_event_fetch(ErlDrvEvent drv_event, SIGSELECT *signo, ErlDrvOseEventId *id, void **extra) .br .RS .LP Write the signal number, id and any extra data associated with \fIdrv_event\fR\& into \fI*signo\fR\& and \fI*id\fR\& respectively\&. \fINULL\fR\& can be also passed as \fIsigno\fR\& or \fIid\fR\& in order to ignore that field\&. .RE .SH "SEE ALSO" .LP \fBdriver_entry(3erl)\fR\&, \fBerl_driver(3erl)\fR\&