org.mbari.siam.moos.deployed
Class LddMaster

java.lang.Object
  extended by org.mbari.siam.moos.deployed.LddMaster

public class LddMaster
extends java.lang.Object

LddMaster provides an application level interface to the StrongARM LDD IO pins, which are similar to GPIO pins, except that they have no interrupt capabilities. The LddMaster accesses these ports using the character special file (/dev/lddio) interface presented by the sa1100lddio.o (lddio) Linux kernel module. It is possible to read several different driver parameters in addition to reading the IO port itself. The read mode of the lddio module sticky; when the read mode is set, subsequent reads will read the parameter specified. To read a different parameter, the read mode must be explicitly set. A number of convenience functions are provided to hide this behavior; the sticky read mode is relevant when using readLdd directly.


Field Summary
static int LDD_ATTN_MSP430
          MSP430 attention bit
static int LDD_BITS
          LDD bits
static java.lang.String LDD_CLEAR_BITS
          Clear bits command
static java.lang.String LDD_DEVICE_NAME
          Name of device file
static int LDD_DIRECTION_INPUT
          Mnemonic for input
static int LDD_DIRECTION_OUTPUT
          Mnemonic for output
static int LDD_GREEN_LED
          Green LED bit
static int LDD_READMODE_DIRECTION
          Mnemonic read mode direction
static int LDD_READMODE_LEVELS
          Mnemonic read mode levels
static int LDD_READMODE_READMODE
          Mnemonic read mode readmode
static int LDD_READMODE_STENCIL
          Mnemonic read mode stencil
static int LDD_RED_LED
          Red LED bit
static int LDD_RF1_POWER
          Radio 1 power bit
static int LDD_RF2_POWER
          Radio 2 power bit
static int LDD_RS485_DRV
          RS485 Tx bit
static int LDD_RS485_RCV
          RS485 Rx bit
static java.lang.String LDD_SET_BITS
          Set bits command
static java.lang.String LDD_SET_INPUT
          Set direction to input command
static java.lang.String LDD_SET_OUTPUT
          Set direction to output command
static java.lang.String LDD_SET_READMODE_DIRECTION
          Read direction command
static java.lang.String LDD_SET_READMODE_LEVELS
          Read levels command
static java.lang.String LDD_SET_READMODE_READMODE
          Read readmode command
static java.lang.String LDD_SET_READMODE_STENCIL
          Read stencil command
static int LDD_STENCIL
          Mask of lower 3 bits (LEDs) and upper 4 bits (used by Sidearm for other nefarious purposes)
static int LDD_UNUSED
          Unused bits
static java.lang.String LDD_WRITE_DIRECTION
          Set direction register
static java.lang.String LDD_WRITE_LEVELS
          Write mask command
static int LDD_YELLOW_LED
          Yellow LED bit
 
Constructor Summary
LddMaster()
           
 
Method Summary
 int applyStencil(int mask)
          Apply stencil to bits (protects bits that should not be touched)
 void clearBits(int mask)
          Clear bits set in mask to the lddio pins
 int getDirection()
          Get LDD direction bits
static LddMaster getInstance()
          Get an LddMaster instance
 int getLevels()
          Get LDD direction bits
 int getReadMode()
          Get current read mode
static void main(java.lang.String[] args)
           
 int readLdd()
          Read Ldd in current readMode
 int readStenciledLdd()
          Read bits and apply specified mask
 void setBits(int mask)
          Write bits set in mask to the lddio pins
 void setDirection(int mask, int direction)
          Set direction for bits in mask
 void setReadMode(int readMode)
          Set to read either the LDD port or the current stencil
 int test()
          Eine Kleine test code
 void writeDirection(int mask)
          Write entire PPDR register
 void writeLdd(java.lang.String data)
          Write Ldd
 void writeLevels(int mask)
          Write mask to the PPSR register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LDD_DEVICE_NAME

public static final java.lang.String LDD_DEVICE_NAME
Name of device file

See Also:
Constant Field Values

LDD_SET_BITS

public static final java.lang.String LDD_SET_BITS
Set bits command

See Also:
Constant Field Values

LDD_CLEAR_BITS

public static final java.lang.String LDD_CLEAR_BITS
Clear bits command

See Also:
Constant Field Values

LDD_WRITE_LEVELS

public static final java.lang.String LDD_WRITE_LEVELS
Write mask command

See Also:
Constant Field Values

LDD_SET_INPUT

public static final java.lang.String LDD_SET_INPUT
Set direction to input command

See Also:
Constant Field Values

LDD_SET_OUTPUT

public static final java.lang.String LDD_SET_OUTPUT
Set direction to output command

See Also:
Constant Field Values

LDD_WRITE_DIRECTION

public static final java.lang.String LDD_WRITE_DIRECTION
Set direction register

See Also:
Constant Field Values

LDD_SET_READMODE_LEVELS

public static final java.lang.String LDD_SET_READMODE_LEVELS
Read levels command

See Also:
Constant Field Values

LDD_SET_READMODE_STENCIL

public static final java.lang.String LDD_SET_READMODE_STENCIL
Read stencil command

See Also:
Constant Field Values

LDD_SET_READMODE_DIRECTION

public static final java.lang.String LDD_SET_READMODE_DIRECTION
Read direction command

See Also:
Constant Field Values

LDD_SET_READMODE_READMODE

public static final java.lang.String LDD_SET_READMODE_READMODE
Read readmode command

See Also:
Constant Field Values

LDD_BITS

public static final int LDD_BITS
LDD bits

See Also:
Constant Field Values

LDD_RED_LED

public static final int LDD_RED_LED
Red LED bit

See Also:
Constant Field Values

LDD_YELLOW_LED

public static final int LDD_YELLOW_LED
Yellow LED bit

See Also:
Constant Field Values

LDD_GREEN_LED

public static final int LDD_GREEN_LED
Green LED bit

See Also:
Constant Field Values

LDD_RS485_RCV

public static final int LDD_RS485_RCV
RS485 Rx bit

See Also:
Constant Field Values

LDD_RS485_DRV

public static final int LDD_RS485_DRV
RS485 Tx bit

See Also:
Constant Field Values

LDD_RF1_POWER

public static final int LDD_RF1_POWER
Radio 1 power bit

See Also:
Constant Field Values

LDD_RF2_POWER

public static final int LDD_RF2_POWER
Radio 2 power bit

See Also:
Constant Field Values

LDD_ATTN_MSP430

public static final int LDD_ATTN_MSP430
MSP430 attention bit

See Also:
Constant Field Values

LDD_UNUSED

public static final int LDD_UNUSED
Unused bits

See Also:
Constant Field Values

LDD_DIRECTION_INPUT

public static final int LDD_DIRECTION_INPUT
Mnemonic for input

See Also:
Constant Field Values

LDD_DIRECTION_OUTPUT

public static final int LDD_DIRECTION_OUTPUT
Mnemonic for output

See Also:
Constant Field Values

LDD_READMODE_LEVELS

public static final int LDD_READMODE_LEVELS
Mnemonic read mode levels

See Also:
Constant Field Values

LDD_READMODE_STENCIL

public static final int LDD_READMODE_STENCIL
Mnemonic read mode stencil

See Also:
Constant Field Values

LDD_READMODE_DIRECTION

public static final int LDD_READMODE_DIRECTION
Mnemonic read mode direction

See Also:
Constant Field Values

LDD_READMODE_READMODE

public static final int LDD_READMODE_READMODE
Mnemonic read mode readmode

See Also:
Constant Field Values

LDD_STENCIL

public static final int LDD_STENCIL
Mask of lower 3 bits (LEDs) and upper 4 bits (used by Sidearm for other nefarious purposes)

See Also:
Constant Field Values
Constructor Detail

LddMaster

public LddMaster()
Method Detail

getInstance

public static LddMaster getInstance()
Get an LddMaster instance


writeLdd

public void writeLdd(java.lang.String data)
Write Ldd


readLdd

public int readLdd()
Read Ldd in current readMode


readStenciledLdd

public int readStenciledLdd()
Read bits and apply specified mask


applyStencil

public int applyStencil(int mask)
Apply stencil to bits (protects bits that should not be touched)


setDirection

public void setDirection(int mask,
                         int direction)
Set direction for bits in mask


getDirection

public int getDirection()
Get LDD direction bits


getLevels

public int getLevels()
Get LDD direction bits


setReadMode

public void setReadMode(int readMode)
Set to read either the LDD port or the current stencil


getReadMode

public int getReadMode()
Get current read mode


writeLevels

public void writeLevels(int mask)
Write mask to the PPSR register


writeDirection

public void writeDirection(int mask)
Write entire PPDR register


setBits

public void setBits(int mask)
Write bits set in mask to the lddio pins


clearBits

public void clearBits(int mask)
Clear bits set in mask to the lddio pins


test

public int test()
Eine Kleine test code


main

public static void main(java.lang.String[] args)


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.