org.mbari.siam.moos.deployed
Class SpiMaster

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

public class SpiMaster
extends java.lang.Object


Field Summary
protected static org.apache.log4j.Logger _log4j
          Log4j logger
static java.lang.String GPIO_DEVICE_NAME
           
static int SPI_ALT_PHASE
           
static int SPI_CLOCK_DIVIDER_256
           
static int SPI_CLOCK_DIVIDER_64
           
static int SPI_DEFAULT_CLOCK
           
static int SPI_DEFAULT_PHASE
           
static java.lang.String SPI_DEVICE_NAME
           
static int SPI_INVERTED_CLOCK
           
static int SPI_LOOPBACK
           
static int SPI_PASSTHROUGH
           
static int SPI_SLAVE_SELECT_0
           
static int SPI_SLAVE_SELECT_1
           
static int SPI_SLAVE_SELECT_2
           
static int SPI_SLAVE_SELECT_3
           
static int SPI_SLAVE_SELECT_4
           
static int SPI_SLAVE_SELECT_5
           
static int SPI_SLAVE_SELECT_GPIO_OFFSET
          Shift slave select values by this amount; uses GPIO bits 4-6
static int SPI_SLAVE_SELECT_MASK
          Slave select mask (only values 0-7 can be used); apply before shift
static int SPI_SLAVE_SELECT_NONE
           
static int SPI_USE_GPIO
           
static int SPI_USE_PORT
           
static int SPI_WORD_WIDTH_16
           
static int SPI_WORD_WIDTH_32
           
static int SPI_WORD_WIDTH_8
           
 
Constructor Summary
SpiMaster()
           
 
Method Summary
static SpiMaster getInstance()
           
 void setClkDivider(int d)
           
 void setSlaveSelect(int cs)
           
 void writeGpio(java.lang.String data)
           
 int writeReadData(int dataOut)
           
 void writeSpi(java.lang.String data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j
Log4j logger


SPI_DEVICE_NAME

public static final java.lang.String SPI_DEVICE_NAME
See Also:
Constant Field Values

GPIO_DEVICE_NAME

public static final java.lang.String GPIO_DEVICE_NAME
See Also:
Constant Field Values

SPI_WORD_WIDTH_8

public static final int SPI_WORD_WIDTH_8
See Also:
Constant Field Values

SPI_WORD_WIDTH_16

public static final int SPI_WORD_WIDTH_16
See Also:
Constant Field Values

SPI_WORD_WIDTH_32

public static final int SPI_WORD_WIDTH_32
See Also:
Constant Field Values

SPI_CLOCK_DIVIDER_256

public static final int SPI_CLOCK_DIVIDER_256
See Also:
Constant Field Values

SPI_CLOCK_DIVIDER_64

public static final int SPI_CLOCK_DIVIDER_64
See Also:
Constant Field Values

SPI_SLAVE_SELECT_NONE

public static final int SPI_SLAVE_SELECT_NONE
See Also:
Constant Field Values

SPI_SLAVE_SELECT_0

public static final int SPI_SLAVE_SELECT_0
See Also:
Constant Field Values

SPI_SLAVE_SELECT_1

public static final int SPI_SLAVE_SELECT_1
See Also:
Constant Field Values

SPI_SLAVE_SELECT_2

public static final int SPI_SLAVE_SELECT_2
See Also:
Constant Field Values

SPI_SLAVE_SELECT_3

public static final int SPI_SLAVE_SELECT_3
See Also:
Constant Field Values

SPI_SLAVE_SELECT_4

public static final int SPI_SLAVE_SELECT_4
See Also:
Constant Field Values

SPI_SLAVE_SELECT_5

public static final int SPI_SLAVE_SELECT_5
See Also:
Constant Field Values

SPI_SLAVE_SELECT_GPIO_OFFSET

public static final int SPI_SLAVE_SELECT_GPIO_OFFSET
Shift slave select values by this amount; uses GPIO bits 4-6

See Also:
Constant Field Values

SPI_SLAVE_SELECT_MASK

public static final int SPI_SLAVE_SELECT_MASK
Slave select mask (only values 0-7 can be used); apply before shift

See Also:
Constant Field Values

SPI_USE_PORT

public static final int SPI_USE_PORT
See Also:
Constant Field Values

SPI_USE_GPIO

public static final int SPI_USE_GPIO
See Also:
Constant Field Values

SPI_PASSTHROUGH

public static final int SPI_PASSTHROUGH
See Also:
Constant Field Values

SPI_LOOPBACK

public static final int SPI_LOOPBACK
See Also:
Constant Field Values

SPI_DEFAULT_PHASE

public static final int SPI_DEFAULT_PHASE
See Also:
Constant Field Values

SPI_ALT_PHASE

public static final int SPI_ALT_PHASE
See Also:
Constant Field Values

SPI_DEFAULT_CLOCK

public static final int SPI_DEFAULT_CLOCK
See Also:
Constant Field Values

SPI_INVERTED_CLOCK

public static final int SPI_INVERTED_CLOCK
See Also:
Constant Field Values
Constructor Detail

SpiMaster

public SpiMaster()
Method Detail

getInstance

public static SpiMaster getInstance()

setClkDivider

public void setClkDivider(int d)

setSlaveSelect

public void setSlaveSelect(int cs)

writeReadData

public int writeReadData(int dataOut)

writeSpi

public void writeSpi(java.lang.String data)

writeGpio

public void writeGpio(java.lang.String data)


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.