fdhwlib  2.0.25
Pbus1394 Class Reference

#include <pbus1394.h>

Inheritance diagram for Pbus1394:
PbusImp

List of all members.

Public Member Functions

Private Types

Private Member Functions

Static Private Member Functions

Private Attributes

Static Private Attributes


Detailed Description

Pbus interface for IEEE1394 interface (firewire).

Performance:

16:59:26>ramspeed
              Access         N     T [s]    Rate [kB/s]  T_access [us]
    Read from Memory      1280     0.928         2694.0          725.0
   Pbus::readBlock()      1280     0.928         2694.0          725.0
    Read with Offset      1280     0.937         2668.1          732.0
  Read single access     10240     0.960           41.7           93.8
 Read register block        80     0.555          246.8         6937.5

The interface supports hotpluging. The ID of the FD Electronic (IEEE1394 SIB board) will be automatically detected after each bus reset.

Additional features:

  • checksum for blocktransfer (not enabled)
  • automatic split of blocks larger than 4kByte.
  • retry in case of access errors
Todo:
Insert hotplugin in the functions checkIR and getIRvector.
  
 IOFireWireBusResetDoneHandler
Called when a bus reset has occured and FireWire has completed configuring the bus.

typedef void (*IOFireWireBusResetDoneHandler)( 
    IOFireWireLibDeviceRef interface, 
    FWClientCommandID commandID );  // parameters may change 
Parameters
interface
A reference to the device on which the callback was installed.
commandID
An FWClientCommandID to be passed to ClientCommandIsComplete().

Definition at line 89 of file pbus1394.h.


Member Typedef Documentation

typedef unsigned long Pbus1394::quadlet_t [private]

Definition at line 167 of file pbus1394.h.


Constructor & Destructor Documentation

Pbus1394::Pbus1394 ( )
Pbus1394::~Pbus1394 ( )

Member Function Documentation

static int Pbus1394::bus1394ResetHandler ( raw1394handle_t  handle,
unsigned int  generation 
) [static, private]

The bus reset handler is called any time the number of devices connected to the firewire interface changes.

Afterwards the node ID of the connected devices changes. The bus handler takes care of the proper address + of the FD Electronic

void Pbus1394::BusResetHandler ( IOFireWireLibDeviceRef  self,
void *   
) [private]
int Pbus1394::checkIR ( ) [virtual]

Reimplemented from PbusImp.

int Pbus1394::free ( int  host = 0) [virtual]

Reimplemented from PbusImp.

int Pbus1394::get ( std::string  item,
std::string *  value 
) [virtual]

Reimplemented from PbusImp.

static int Pbus1394::get1394NodeId ( ) [static, private]

Find the node where the FD Electronic is connected to.

The function will set the id of the crate in the member variable id1394.

Returns:
0 success crate found, 1 no error, but no crate connected, -1 (or other negative numbers) error while searching the connected firewire devices
unsigned long Pbus1394::getIRvector ( ) [virtual]

Reimplemented from PbusImp.

const char* Pbus1394::getLibName ( ) [virtual]

Reimplemented from PbusImp.

const char* Pbus1394::getMode ( ) [virtual]

Reimplemented from PbusImp.

int Pbus1394::getModeId ( ) [virtual]

Reimplemented from PbusImp.

unsigned long Pbus1394::getState ( ) [virtual]

Reimplemented from PbusImp.

unsigned long Pbus1394::getState ( unsigned long  addr) [virtual]

Reimplemented from PbusImp.

void Pbus1394::handleError ( const char *  cmd,
unsigned long  addr,
int  nLoop,
int  errNo 
) [private]

Routine called in case of errors during ieee1394 access from rawRead, rawWrite, readBlock.

int Pbus1394::init ( char *  inifile,
int  host = 0 
) [virtual]

Initilaization of the Pbus interface.

The function will throw an error if the interface is not avaialble The missing or powered-off FD Electronic will cause a warning but no error.

Reimplemented from PbusImp.

int Pbus1394::raw1394_read ( int  handle,
unsigned long  id,
long long  addr,
unsigned long  len,
unsigned long *  data 
) [private]

Rebuild interface of libraw1394 library.

int Pbus1394::raw1394_write ( int  handle,
unsigned long  id,
long long  addr,
unsigned long  len,
unsigned long *  data 
) [private]

Rebuild interface of libraw1394 library.

unsigned long Pbus1394::rawRead ( unsigned long  addr) [virtual]

Read data from the electronics via a special interface.

Re-implement this function for every interface.

Reimplemented from PbusImp.

void Pbus1394::rawWrite ( unsigned long  addr,
unsigned long  data 
) [virtual]

Write data to the electronics via a special interface.

Re-implement this function for every interface.

Reimplemented from PbusImp.

void Pbus1394::readBlock ( unsigned long  addr,
unsigned long *  data,
unsigned long  n,
unsigned long  incr = 1 
) [virtual]

Read data a continuous block of data.

The function protects a loop of rawRead calls. Normally the function is overloaded using dedicated block transfer operation.

Reimplemented from PbusImp.

void Pbus1394::readRegisterBlock ( unsigned long  addr,
unsigned long *  data,
unsigned long  nPix,
unsigned long  incrPix,
unsigned long  nSlots = 1,
unsigned long  incrSlots = 0 
) [virtual]

IEEE1394 interface allows to use the broadcast address (0x1f) also for reading all register for all pixel with a single command.

Reimplemented from PbusImp.

void Pbus1394::reset ( ) [virtual]

Reset of the Pbus access layer.

Reimplemented from PbusImp.

static int Pbus1394::tag1394Handler ( raw1394handle_t  handle,
unsigned long  tag,
raw1394_errcode_t  errcode 
) [static, private]

Display more error messages.

int Pbus1394::waitForIR ( int  timeout) [virtual]

Reimplemented from PbusImp.


Member Data Documentation

raw1394handle_t Pbus1394::handle1394 [static, private]

Handle for the IEEE1394 interface.

The handle is initialize once with the creation of the class.

Definition at line 185 of file pbus1394.h.

unsigned int Pbus1394::handle1394 [private]

Unused.

Definition at line 203 of file pbus1394.h.

int Pbus1394::id1394 [static, private]

Node ID of the first IEEE1394 port found where the crate can be accessed.

This node number has to be re-read after every bus reset. A removal or addition of a device will cause a bus reset.

Definition at line 195 of file pbus1394.h.

int Pbus1394::idCard [static, private]

Node ID of the IEEE1394 interface card.

Definition at line 198 of file pbus1394.h.

IOCFPlugInInterface** Pbus1394::interface [static, private]

Apple IOKit interface descriptor.

Definition at line 209 of file pbus1394.h.

unsigned long Pbus1394::logNo [static, private]

Number of the syslog message.

Definition at line 230 of file pbus1394.h.

struct raw1394_portinfo* Pbus1394::p1394info [static, private]

Some IEEE1394 infomration about the available ports.

Definition at line 188 of file pbus1394.h.

bool Pbus1394::resetDetected [static, private]

Flag to indicate that the node id has to be read again.

Definition at line 217 of file pbus1394.h.

io_object_t Pbus1394::service [static, private]

Apple IOKit service descriptor.

Definition at line 206 of file pbus1394.h.

int Pbus1394::sibMajorVersion [static, private]

Version of the interface board implementation.

Definition at line 221 of file pbus1394.h.

int Pbus1394::sibMinorVersion [static, private]

Definition at line 223 of file pbus1394.h.

unsigned long Pbus1394::sibStatus [static, private]

Status of the interface board.

Definition at line 227 of file pbus1394.h.

IOFireWireLibNubRef Pbus1394::unit [static, private]

Apple IOKit unit descriptor.

Definition at line 212 of file pbus1394.h.


The documentation for this class was generated from the following file: