User`s manual
Software Manual • EKF Intelligent I/O Controller Family On
CompactPCI
- 57 -
EKF Elektronik GmbH * Philipp-Reis-Str. 4 * D-59065 HAMM (Germany)
Tel. +49 (0)2381/6890-0 * Fax. +49 (0)2381/6890-90 * E-Mail info@ekf.de * Internet http://www.ekf.de
Exchan
g
in
g
Messa
g
es With The Controller
When requesting a service from the controller, this is done by the following sequence:
1. Set up a command word with all flags cleared in a local variable.
2. Copy parameter or data to the corresponding area of the MU (if any).
3. Write the command word to the controller’s IMR0.
The last step will request an interrupt on the controller that is servicing the message.
The controller will always answer to a message that was send before, even if the message
contains an unknown command code or bogus parameters. On reply do the following:
1. Check bit 0 of OISR for an MU interrupt request.
2. Read the contents of OMR0 to a local variable. This contains the reply to the
message.
3. Clear the IRQ by writing RP_MU_OISR_MSG0 to OISR.
4. Check the command word replied, especially the flags are giving information about
the status of the requested command.
Do step 3 as quickly as possible since this allows the controller to reuse the MU for other
messages.
The controller does not change the command code and port ID in the reply message, thus
it is easy for the driver to identify the action to which the reply belongs.
The controller sets certain flags in the reply message depending on the state of the
requested command:
The reply flag is set to reflect that this message is the answer to a command
requested before, i.e. this is a reply message.
The complete flag is set when all necessary actions are done by the controller, i.e. the
corresponding command is complete. This message is a complete message.
The error flag is set when something was wrong. This includes a bad command code,
bad or missing parameters and so on. The command data field of the command word
contains a 16-bit error code that specifies the reason of the failure. Error codes are
defined in the C header file “ekf960if.h”.
The controller may send a message in response to a message sent by the host. In this case
the RPL flag is set in the reply message. If the requested command could be completed
immediately, e.g. setting the baud rate of a port, the CPL flag is also set.
On the other side, when for example the host requests to transmit data over a serial port, the
reply message will have the CPL flag cleared, because the data transmission will last a
while. In that case the controller sends a separate complete message with CPL flag set, but
RPL flag cleared, as soon as the controller is able to receive new transmit data. Note that
this complete message will arrive asynchronously at any time.