com.buglabs.bug.module.vonhippel.pub
Interface IVonHippelModuleControl

All Known Implementing Classes:
VonHippelModuleControl

public interface IVonHippelModuleControl


Field Summary
static int VH_ADC_W1_CH0
           
static int VH_ADC_W1_CH01
           
static int VH_ADC_W1_CH1
           
static int VH_ADC_W1_CH10
           
static int VH_ADC_W1_CH2
           
static int VH_ADC_W1_CH23
           
static int VH_ADC_W1_CH3
           
static int VH_ADC_W1_CH32
           
static int VH_ADC_W1_EN
           
static int VH_ADC_W2_EN
           
static int VH_ADC_W2_IM
           
static int VH_ADC_W2_SPD
           
static int VH_DAC_BCH
           
static int VH_DAC_CHA
           
static int VH_DAC_CHB
           
static int VH_DAC_PD100K
           
static int VH_DAC_PD1K
           
static int VH_DAC_PDF
           
static int VH_DAC_PU
           
static int VH_DAC_W1_ALL
           
static int VH_DAC_W1_ALLA
           
static int VH_DAC_W1_ALLB
           
static int VH_DAC_W1_ALLI
           
static int VH_DAC_W1_EC
           
static int VH_DAC_W1_LA
           
static int VH_DAC_W1_LB
           
static int VH_DAC_W1_RDA
           
static int VH_DAC_W1_RDB
           
static int VH_DAC_W1_UA
           
static int VH_DAC_W1_UALL
           
static int VH_DAC_W1_UB
           
 
Method Summary
 void clearGPIO(int pin)
          Sets specified pin as low
 void clearIOX(int pin)
          Sets specified IOX pin as high.
 int getRDACResistance()
          Get RDAC resistance value from ioctl
 java.io.InputStream getRS232InputStream()
          Deprecated.  
 java.io.OutputStream getRS232OutputStream()
          Deprecated.  
 int getStatus()
          Returns status of module.
 int LEDGreenOff()
          Set module's Green LED off.
 int LEDGreenOn()
          Set module's Green LED on.
 int LEDRedOff()
          Set module's Red LED off.
 int LEDRedOn()
          Set module's Red LED on.
 void makeGPIOIn(int pin)
          Sets specified pin as an in pin.
 void makeGPIOOut(int pin)
          Sets specified pin as an output pin.
 void makeIOXIn(int pin)
          Sets specified IOX pin as an in pin
 void makeIOXOut(int pin)
          Sets specified IOX pin as an out pin
 int readADC()
          Read value after last conversion.
 int readDAC(int channel)
          Read channel after last conversion.
 void setGPIO(int pin)
          Sets specified pin as high
 void setIOX(int pin)
          Sets specified IOX pin as high.
 void setRDACResistance(int resistance)
          Set RDAC to adjust LDO voltage
 void writeADC(int control)
           
 void writeDAC(int digital)
           
 

Field Detail

VH_ADC_W1_EN

static final int VH_ADC_W1_EN
See Also:
Constant Field Values

VH_ADC_W1_CH01

static final int VH_ADC_W1_CH01
See Also:
Constant Field Values

VH_ADC_W1_CH23

static final int VH_ADC_W1_CH23
See Also:
Constant Field Values

VH_ADC_W1_CH10

static final int VH_ADC_W1_CH10
See Also:
Constant Field Values

VH_ADC_W1_CH32

static final int VH_ADC_W1_CH32
See Also:
Constant Field Values

VH_ADC_W1_CH0

static final int VH_ADC_W1_CH0
See Also:
Constant Field Values

VH_ADC_W1_CH1

static final int VH_ADC_W1_CH1
See Also:
Constant Field Values

VH_ADC_W1_CH2

static final int VH_ADC_W1_CH2
See Also:
Constant Field Values

VH_ADC_W1_CH3

static final int VH_ADC_W1_CH3
See Also:
Constant Field Values

VH_ADC_W2_EN

static final int VH_ADC_W2_EN
See Also:
Constant Field Values

VH_ADC_W2_IM

static final int VH_ADC_W2_IM
See Also:
Constant Field Values

VH_ADC_W2_SPD

static final int VH_ADC_W2_SPD
See Also:
Constant Field Values

VH_DAC_W1_UA

static final int VH_DAC_W1_UA
See Also:
Constant Field Values

VH_DAC_W1_UB

static final int VH_DAC_W1_UB
See Also:
Constant Field Values

VH_DAC_W1_LA

static final int VH_DAC_W1_LA
See Also:
Constant Field Values

VH_DAC_W1_LB

static final int VH_DAC_W1_LB
See Also:
Constant Field Values

VH_DAC_W1_ALLA

static final int VH_DAC_W1_ALLA
See Also:
Constant Field Values

VH_DAC_W1_ALLB

static final int VH_DAC_W1_ALLB
See Also:
Constant Field Values

VH_DAC_W1_ALL

static final int VH_DAC_W1_ALL
See Also:
Constant Field Values

VH_DAC_W1_ALLI

static final int VH_DAC_W1_ALLI
See Also:
Constant Field Values

VH_DAC_W1_UALL

static final int VH_DAC_W1_UALL
See Also:
Constant Field Values

VH_DAC_W1_EC

static final int VH_DAC_W1_EC
See Also:
Constant Field Values

VH_DAC_BCH

static final int VH_DAC_BCH
See Also:
Constant Field Values

VH_DAC_CHB

static final int VH_DAC_CHB
See Also:
Constant Field Values

VH_DAC_CHA

static final int VH_DAC_CHA
See Also:
Constant Field Values

VH_DAC_PD100K

static final int VH_DAC_PD100K
See Also:
Constant Field Values

VH_DAC_PD1K

static final int VH_DAC_PD1K
See Also:
Constant Field Values

VH_DAC_PDF

static final int VH_DAC_PDF
See Also:
Constant Field Values

VH_DAC_PU

static final int VH_DAC_PU
See Also:
Constant Field Values

VH_DAC_W1_RDA

static final int VH_DAC_W1_RDA
See Also:
Constant Field Values

VH_DAC_W1_RDB

static final int VH_DAC_W1_RDB
See Also:
Constant Field Values
Method Detail

LEDRedOff

int LEDRedOff()
              throws java.io.IOException
Set module's Red LED off. Note that the state of the LED will also be reflected in GPIO pin 3

Returns:
value returned by ioctl.
Throws:
java.io.IOException

LEDRedOn

int LEDRedOn()
             throws java.io.IOException
Set module's Red LED on. Note that the state of the LED will also be reflected in GPIO pin 3

Returns:
value returned by ioctl.
Throws:
java.io.IOException

LEDGreenOff

int LEDGreenOff()
                throws java.io.IOException
Set module's Green LED off. Note that the state of the LED will also be reflected in GPIO pin 2

Returns:
value returned by ioctl.
Throws:
java.io.IOException

LEDGreenOn

int LEDGreenOn()
               throws java.io.IOException
Set module's Green LED on. Note that the state of the LED will also be reflected in GPIO pin 2

Returns:
value returned by ioctl.
Throws:
java.io.IOException

getStatus

int getStatus()
              throws java.io.IOException
Returns status of module. As passed up from ioctl. for information about the format please see line 500 at bug-linux-2.6.27.2/drivers/bmi/pims/vonhippel/bmi_vh.c

Returns:
integer containing status information of GPIO and IOX bits
Throws:
java.io.IOException

makeGPIOOut

void makeGPIOOut(int pin)
                 throws java.io.IOException
Sets specified pin as an output pin. Note that the driver sets pins 2 and 3 as out by default

Parameters:
pin - to set as Out
Throws:
java.io.IOException

makeGPIOIn

void makeGPIOIn(int pin)
                throws java.io.IOException
Sets specified pin as an in pin. Note that the driver sets pins 0 and 1 as in by default

Parameters:
pin - to set as Out
Throws:
java.io.IOException

setGPIO

void setGPIO(int pin)
             throws java.io.IOException
Sets specified pin as high

Parameters:
pin - to set as high
Throws:
java.io.IOException

clearGPIO

void clearGPIO(int pin)
               throws java.io.IOException
Sets specified pin as low

Parameters:
pin - to set as low
Throws:
java.io.IOException

makeIOXOut

void makeIOXOut(int pin)
                throws java.io.IOException
Sets specified IOX pin as an out pin

Parameters:
IOX - pin to set as Out
Throws:
java.io.IOException

makeIOXIn

void makeIOXIn(int pin)
               throws java.io.IOException
Sets specified IOX pin as an in pin

Parameters:
IOX - pin to set as in
Throws:
java.io.IOException

setIOX

void setIOX(int pin)
            throws java.io.IOException
Sets specified IOX pin as high. Note that pin 0 will set Red LED on (not GPIO red), 1 will set yellow LED on, 2 will set green LED on (not GPIO LED), 3 will set blue LED on.

Parameters:
IOX - pin to set as high
Throws:
java.io.IOException

clearIOX

void clearIOX(int pin)
              throws java.io.IOException
Sets specified IOX pin as high. Note that pin 0 will set Red LED off (not GPIO red), 1 will set yellow LED off, 2 will set green LED off (not GPIO LED), 3 will set blue LED off.

Parameters:
IOX - pin to set as low
Throws:
java.io.IOException

setRDACResistance

void setRDACResistance(int resistance)
                       throws java.io.IOException
Set RDAC to adjust LDO voltage

Parameters:
resistance - value
Throws:
java.io.IOException

getRDACResistance

int getRDACResistance()
                      throws java.io.IOException
Get RDAC resistance value from ioctl

Parameters:
resistance - value
Throws:
java.io.IOException

writeADC

void writeADC(int control)
              throws java.io.IOException
Parameters:
control - the control word to be written to ADC. Used to initiate ADC conversion and also configure ADC device for ADC single-ended or differential, among other things. see bmi_vh.h and bmi_vh.c in kernel.
Throws:
java.io.IOException

readADC

int readADC()
            throws java.io.IOException
Read value after last conversion.

Throws:
java.io.IOException

writeDAC

void writeDAC(int digital)
              throws java.io.IOException
Parameters:
digital - the control word encoded digital input to be encoded as analog out. See datasheet and bmi_vh.h and bmi_vh.c in kernel.
Throws:
java.io.IOException

readDAC

int readDAC(int channel)
            throws java.io.IOException
Read channel after last conversion.

Parameters:
channel - should be either VH_DAC_W1_RDA for channel A or VH_DAC_W1_RDB for channel B.
Throws:
java.io.IOException

getRS232InputStream

java.io.InputStream getRS232InputStream()
Deprecated. 

Gets the input stream associated with the RS232 port on Von Hippel module. This implementation is based on the javax.microedition.commports API. The port is set up with the following parameters in VonHippelModuleControl: baudrate=9600 bitsperchar=8 stopbits=1 parity=none autocts=off autorts=off blocking=off

Returns:
stream associated with RS232 input (reading)

getRS232OutputStream

java.io.OutputStream getRS232OutputStream()
Deprecated. 

Gets the output stream associated with the RS232 port on Von Hippel module. This implementation is based on the javax.microedition.commports API. The port is set up with the following parameters in VonHippelModuleControl: baudrate=9600 bitsperchar=8 stopbits=1 parity=none autocts=off autorts=off blocking=off

Returns:
stream associated with RS232 output (writing)