pcmciainterface
Class Pcmcia

java.lang.Object
  |
  +--pcmciainterface.Pcmcia

public class Pcmcia
extends java.lang.Object

Title: PCMCIA I/O Utilities

Description: PCMCIA driver interface

Copyright: Copyright (c) 2005

Company: Mobile Satellite Services Corporation

Version:
1.0
Author:
Poornima Sarvadevabhatla

Constructor Summary
Pcmcia()
           
 
Method Summary
(package private) static void ()
           
 void disposeHandle()
          Disposes a handle to the driver.
 void getHandle()
          Gets handle to the driver.
 int readIoFixAddr8bit(int address, int noOfBytesToRead, byte[] bufferForReadValues)
          Reads 8-bit words from I/O space at a fixed address.
 int readMemoryFixAddr16bit(int address, int noOfBytesToRead, byte[] bufferForReadValues)
          Reads 16-bit words from common memory space at a fixed address.
 int writeIoFixAddr8bit(int address, int noOfBytesToWrite, byte[] bufferWithValuesToWrite)
          Writes 8-bit words to I/O space at a fixed address.
 int writeMemFixAddr16bit(int address, int noOfBytesToWrite, byte[] bufferWithValuesToWrite)
          Writes 16-bit words to common memory space at a fixed address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pcmcia

public Pcmcia()
Method Detail

static void ()

getHandle

public void getHandle()
               throws GetHandleException
Gets handle to the driver. Before any communiation with the hardware can take place, a handle must be established. The handle can be kept for long periods of time and it is NOT recommended that the handle be disposed after each access with the hardware.
Throws:
GetHandleException - if there was a problem

disposeHandle

public void disposeHandle()
Disposes a handle to the driver. This method will never throw any exceptions, not even if a handle wasn't established in the first place. Handles can be kept for long periods of time and it is NOT recommended that the handle be disposed after each access with the hardware.

readMemoryFixAddr16bit

public int readMemoryFixAddr16bit(int address,
                                  int noOfBytesToRead,
                                  byte[] bufferForReadValues)
                           throws NoHandleException,
                                  BadParameterException,
                                  UnknownPcmciaErrorException
Reads 16-bit words from common memory space at a fixed address.
Parameters:
address - the address at which the access to the hardware will take place at. The address must be in the asssigned common memory space. Must be an even number.
noOfBytesToRead - the number of bytes to read. Must be an even number.
bufferForReadValues - a buffer for the read data. The size of the buffer in bytes must be equal to or greater than noOfBytesToRead.
Returns:
a negative number if there was a problem, otherwise the number of bytes read will be returned.
Throws:
BadParameterException - if one or several parameter have invalid values.
NoHandleException - if there is currently no handle established with the driver.
UnknownPcmciaErrorException - if an unknown error occurred.

readIoFixAddr8bit

public int readIoFixAddr8bit(int address,
                             int noOfBytesToRead,
                             byte[] bufferForReadValues)
                      throws NoHandleException,
                             BadParameterException,
                             UnknownPcmciaErrorException
Reads 8-bit words from I/O space at a fixed address.
Parameters:
address - the address at which the access to the hardware will take place at. The address must be in the asssigned I/O space.
noOfBytesToRead - the number of bytes to read.
bufferForReadValues - a buffer for the read data. The size of the buffer in bytes must be equal to or greater than noOfBytesToRead.
Returns:
a negative number if there was a problem, otherwise the number of bytes read will be returned.
Throws:
BadParameterException - if one or several parameter have invalid values.
NoHandleException - if there is currently no handle established with the driver.
UnknownPcmciaErrorException - if an unknown error occurred.

writeMemFixAddr16bit

public int writeMemFixAddr16bit(int address,
                                int noOfBytesToWrite,
                                byte[] bufferWithValuesToWrite)
                         throws NoHandleException,
                                BadParameterException,
                                UnknownPcmciaErrorException
Writes 16-bit words to common memory space at a fixed address.
Parameters:
address - the address at which the first access to the hardware will take place at. The address must be in the asssigned common memory space. Must be an even number.
noOfBytesToWrite - the number of bytes to write. Must be an even number.
bufferWithValuesToWrite - a buffer containing the data to be stored in the hardware. The size of the buffer in bytes must be equal to or greater than noOfBytesToWrite.
Returns:
a negative number if there was a problem, otherwise the number of bytes written will be returned.
Throws:
BadParameterException - if one or several parameter have invalid values.
NoHandleException - if there is currently no handle established with the driver.
UnknownPcmciaErrorException - if an unknown error occurred.

writeIoFixAddr8bit

public int writeIoFixAddr8bit(int address,
                              int noOfBytesToWrite,
                              byte[] bufferWithValuesToWrite)
                       throws NoHandleException,
                              BadParameterException,
                              UnknownPcmciaErrorException
Writes 8-bit words to I/O space at a fixed address.
Parameters:
address - the address at which the access to the hardware will take place at. The address must be in the asssigned I/O space.
noOfBytesToWrite - the number of bytes to write.
bufferWithValuesToWrite - a buffer containing the data to be stored in the hardware. The size of the buffer in bytes must be equal to or greater than noOfBytesToWrite.
Returns:
a negative number if there was a problem, otherwise the number of bytes written will be returned.
Throws:
BadParameterException - if one or several parameter have invalid values.
NoHandleException - if there is currently no handle established with the driver.
UnknownPcmciaErrorException - if an unknown error occurred.