
Arcom Embedded Linux Technical Manual Developing software for AEL
Using an Arcom PC/104 I/O board
AEL comes pre-installed with drivers for a selection of Arcom’s PC/104 I/O boards. The
following AIM104 peripheral boards are supported:
Board Module Device node
AIM104-RELAY8/IN8 aim104-relay.o /dev/arcom/aim104/relay8/{0..7}
AIM104-IN16 aim104-in16.o /dev/arcom/aim104/in16/{0..7}
AIM104-OUT16 aim104-out16.o /dev/arcom/aim104/out16/{0..7}
AIM104-IO32 aim104-io32.o /dev/arcom/aim104/io32/{0..7}
AIM104-MULTI-IO aim104.multi-io.o /dev/arcom/aim104/multi-io/{0..7}
Peripheral boards containing serial ports, such as the AIM104-COM4 and the
AIM104-COM8, are supported by the standard 16550 UART driver in the Linux
kernel. These boards can be configured using setserial, as described on page
13
.
The drivers are supplied as kernel modules that must be loaded to access the device.
Each module can support up to eight individual boards that are configured by passing a
list of I/O addresses using the io_base= module parameter. This is a comma-separated
list of addresses. For example, if you have two AIM104-RELAY8/IN8 boards with base
addresses configured as 0x180 and 0x184:
modprobe aim104-relay8 io_base=0x180,0x184
Some boards may require an offset to be added to the base address. Refer to
the board’s Quickstart Manual for details.
Once the kernel driver has been loaded then the libaim104 library can be used to
access the AIM104 boards. The library provides functions for each of the peripheral
boards. The functions are defined in the C header file arcom/libaim104.h.
Each function takes a file handle obtained by opening the device node listed in the
above table. All functions return 0 or a positive value on success, and a negative value
on failure. The possible libaim104 error codes are explained in the following table:
Error code Explanation
AIM104_SUCCESS = 0 Success. No error occurred.
AIM104_EBAD_CHANNEL = -10 The given channel is invalid.
AIM104_EIO = -20 Low-level I/O error. Check errno for details.
AIM104_ERANGE = -30 The given value was out of range.
© 2006 Arcom Issue G 49
Komentarze do niniejszej Instrukcji