Reinventing the Shift Register with Comedi?

I've got a project and I think Comedi is the only tool short of a custom
board that might be able to pull it off.

I need to interface to some ancient (circa 1978) encryption gear.  I need to
be able to bit bang some configuration data into and out of this box.

The crypto unit produces a internal clock at 5kHz.  To configure the unit I
have to set an enable line high and then clock a 16 bit configuration word
in one bit at a time in sync with the clock.  According to the timing
diagram I need to update my output line on the rising clock edge.

Assuming all goes well with that, then I have to read a 24 bit response
back.  But the unit I am talking to updates its output on a rising clock
edge so I need to read the line on a faling clock edge.

Basically I see the problem as implementing a shift register in software
using Comedi but with the added twist of needing to drive off of either a
rising or falling clock edge.

 From reading the API documentation, this looks feasible to do what I want.
But I do not see the API allowing falling edge triggering.

Do I need to invert the clock line to implement falling edge triggering or
am I missing something?

Does what I describe (using Comedi to implement a shift register) sound
feasible?  Has it been done?  I tried searching the archives with no luck.

Thanks for your time,
David Smoot

Received on 2006-08-07Z21:21:08