From cd69c2a54201b4e0c4ba86d4248937120e1957e7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 8 Jan 2014 18:54:15 +0100 Subject: ose: Create OSE application Create an specific OSE application that mainly contains documentation around the OSE specific part of Erlang/OTP. --- lib/ose/doc/src/ose_erl_driver.xml | 109 +++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 lib/ose/doc/src/ose_erl_driver.xml (limited to 'lib/ose/doc/src/ose_erl_driver.xml') diff --git a/lib/ose/doc/src/ose_erl_driver.xml b/lib/ose/doc/src/ose_erl_driver.xml new file mode 100644 index 0000000000..6687d78087 --- /dev/null +++ b/lib/ose/doc/src/ose_erl_driver.xml @@ -0,0 +1,109 @@ + + + + +
+ + 20132014 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + erl_driver for Enea OSE + Lukas Larsson + + 2014-01-08 + A + ose_erl_driver.xml +
+ ose_erl_driver + Linked-in drivers in Enea OSE + +

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. +

+
+
+ DATA TYPES + + + union SIGNAL + See the Enea OSE SPI documentation for a description. + SIGSELECT + See the Enea OSE SPI documentation for a description. + ErlDrvEvent + The ErlDrvEvent is a handle to a signal number and id combination. It is passed to driver_select(3). + ErlDrvOseEventId + This is the id used to associate a specific signal to a + certain driver instance. + +
+ + + union SIGNAL *erl_drv_ose_get_signal(ErlDrvEvent drv_event) + + +

Fetch the next signal associated with drv_event. + Signals will be returned in the order which they were received and + when no more signals are available NULL will be returned. + Use this function in the ready_input/ready_output callbacks + to get signals.

+
+
+ + ErlDrvEventerl_drv_ose_event_alloc(SIGSELECT signo, ErlDrvOseEventId id, ErlDrvOseEventId (*resolve_signal)(union SIGNAL* sig)) + + +

Create a new ErlDrvEvent associated with signo, + id and uses the resolve_signal function to extract + the id from a signal with signo. See + + Signals in a Linked-in driver in the OSE User's Guide. +

+
+
+ + voiderl_drv_ose_event_free(ErlDrvEvent drv_event) + + +

Free a ErlDrvEvent. This should always be done in the + stop_select + callback when the event is no longer being used.

+
+
+ + voiderl_drv_ose_event_fetch(ErlDrvEvent drv_event, SIGSELECT *signo, int *id) + + +

Write the signal number and id associated with drv_event + into *signo and *id respectively. NULL can be + also passed as signo or id in order to ignore that field. +

+
+
+
+
+ SEE ALSO +

+ driver_entry(3), + erl_driver(3) +

+
+
-- cgit v1.2.3