- gpio.register(groupid, group, device, address)
- gpio.unregister(groupid)
SYNOPSIS
DESCRIPTION
This function will register an external multi-IO device (MIO). Once registered, the system will automatically poll the device in regular intervals. The standard gpio functions can be used to access the inputs and outputs on the MIO.
The variable groupid uniquely identifies the device. It can be freely chosen, but must be unique for each registered device and must be in the range 0x0100...0xFFFF. The ID is used as the group parameter in all other gpio functions to reach the device.
The variable group identifies the parent group. Currently, this must be GPGRP_MUPP to indicate devices that talk the MUPP or MUPP/E protocol.
device contains the serial device used. This may be any serial port (/dev/ttySx). On the V4, you can also use /dev/mbus for devices attached to the µBus connector. Finally, address indicates the address of the device on the bus. Devices usually have jumpers or DIP-switches to select an address.
When not needed, a device can be unregistered again, using the same id as was used when it was registered.
RETURN VALUE
EXAMPLE
Assuming a V4 controller with an eeMIO attached to the µBus connector on address 0.