
micif
=====

The micif program is an attempt to add a layer of abstraction between
the application programs running on the CMC and the actual system
hardware.  At the moment it is used to return information about the
buttons and hardware revision of the board.

It is expected that there will be multiple version of this program, a
diffrent one for each hardware platform.  They must all have the same
interface (or a very similar one).  This text file documents the
Spider2 / MIC-400 version.

The program is called micif.sh when in git, but gets copied to
/usr/bin/micif on the target board, so clients can just call "micif".

The options are as follows:

 -h
     Show some help

 -A
     Returns information about the "assoc" button.  Two numbers are
     returned; the first is the 'state' of the button - a '1' means
     pressed.  The second number is a flag that is '1' if the button
     state has changed sine it was last checked.

 -X
     Returns the 'state' of the "!" button.  A '1' is returned if the
     button is pressed.

 -T
     Returns the board type and the amount of RAM installed on the
     target.  The board type is specific to the archtecture that we
     are running on.  The amount of RAM is in MB's.  The third value
     is unused on the MIC-400.

     For the MIC-400 8 is returned as board type.

 -S
     Returns the hardware status bits.  For the MIC-400 this is the
     lower four bits of the MIC_STATUS0 register.

Here is a short log from a MIC-400:

# micif -A
0 0
# micif -X
0
# micif -T
0 512 0
# assoc button pressed and held
# micif -A
1 1
# assoc button release
# micif -A
0 1
# micif -A
0 0
# assoc button pressed and released
# micif -A
0 1
# micif -A
0 0
