Newsgroups: comp.sys.transputer
From: eh036@cleveland.Freenet.Edu (Joseph M. Susnjara)
Subject: Re: outp() for INMOS ANSI C
Organization: Case Western Reserve University, Cleveland, Ohio (USA)
Date: 18 Apr 1994 22:01:25 GMT
Message-ID: <2ouvvm$cgj@usenet.INS.CWRU.Edu>


I worked on a PC-transputer project a few years ago. I needed to
give my T800 access to the VGA and analog I/O cards connected to 
my PC.

The iserver that I was using had a big switch statement in the
source code.  Each case corresponded to a function that the 
server could perform for the transputer.

You need to add two cases to this switch statement. One case 
should call outp() and the other should call inp().  On the
transputer side, you should create two functions called outp
and inp.

The transputer's outp will call server_transaction, which is 
the generic function for accessing the server.  The buffer
passed to server_transaction will contain the following:

  1. The length of the buffer.

  2. The number corresponding to the case (iserver function)
      you want to execute.

  3. Any data you want to pass to the iserver function.


This technique can be used to give the transputer access to 
any I/O device connected to the PC.

Note: There is a significant amount of overhead associated 
with a call to server_transaction.  If you will be calling
inp() or outp() inside a loop, move the loop over to the
PC side to minimize server transactions.

     Joe Susnjara
      Honeywell Air Transport
     susnjara@cdc4320.ateng.az.honeywell.com

