メインページ   モジュール   名前空間一覧   クラス階層   アルファベット順一覧   構成   ファイル一覧   構成メンバ   ファイルメンバ   関連ページ    

TCamacInterruptRegisterModule.cc

解説を見る。
00001 // =====================================================================
00002 //  $Id: TCamacInterruptRegisterModule.cc,v 1.4 2004/03/07 10:30:31 goiwai Exp $
00003 //  $Name: CLDAQ-1-14-03 $
00004 //  $Log: TCamacInterruptRegisterModule.cc,v $
00005 //  Revision 1.4  2004/03/07 10:30:31  goiwai
00006 //  ROOTに組みこむためのおまじないマクロを埋めこみました。
00007 //  全てにおいて完全に動作するわけではありません。
00008 //
00009 //  Revision 1.3  2003/10/06 17:02:40  goiwai
00010 //  *** empty log message ***
00011 //
00012 //  Revision 1.2  2003/07/30 16:19:10  goiwai
00013 //  ファイルにコミットログをつけることにしました.
00014 //
00015 // =====================================================================
00016 #include "TCamacInterruptRegisterModule.hh"
00017 #include "TDataSegment.hh"
00018 #include "TDataElement.hh"
00019 
00020 TCamacInterruptRegisterModule::TCamacInterruptRegisterModule( TCamacCrateController* cc7x00, Tint slot, Tint nch, Tdata_t datalen )
00021   : TCamacModule( cc7x00, slot, nch, datalen )
00022 {;}
00023 
00024 TCamacInterruptRegisterModule::TCamacInterruptRegisterModule( const TCamacInterruptRegisterModule& right )
00025   : TCamacModule( right )
00026 {;}
00027 
00028 TCamacInterruptRegisterModule::~TCamacInterruptRegisterModule()
00029 {;}
00030 
00031 const TCamacInterruptRegisterModule& TCamacInterruptRegisterModule::operator=( const TCamacInterruptRegisterModule& right )
00032 {
00033   *( (TCamacModule*)this ) = *( (TCamacModule*)(&right) );
00034   return *this;
00035 }
00036 
00037 Tbool TCamacInterruptRegisterModule::operator==( const TCamacInterruptRegisterModule& right ) const
00038 {
00039   return *( (TCamacModule*)this ) == *( (TCamacModule*)(&right) );
00040 }
00041 
00042 Tbool TCamacInterruptRegisterModule::operator!=( const TCamacInterruptRegisterModule& right ) const
00043 {
00044   return *( (TCamacModule*)this ) != *( (TCamacModule*)(&right) );
00045 }
00046 
00047 Tvoid TCamacInterruptRegisterModule::FillData( TDataElement& element, Tint channel )
00048 {
00049   if ( channel < 0 || channel >= theNumberOfChannels ) {
00050     Tcerr << "TCamacInterruptRegisterModule::FillData: invalid ID " << channel << Tendl;
00051     element.FillData( &theStatus, tTypeInt, 1 );
00052   } else if ( channel == 0 ) {
00053     ReadInterruptRegister();
00054     element.FillData( &theCamacData, tTypeUnsignedInt, 1 );
00055   } else if ( channel == 1 ) {
00056     ReadInterruptMaskRegister();
00057     element.FillData( &theCamacData, tTypeUnsignedInt, 1 );
00058   } else {
00059     // status filled
00060     element.FillData( &theStatus, tTypeInt, 1 );
00061   }
00062   return;
00063 }
00064 
00065 Tint TCamacInterruptRegisterModule::Initialize()
00066 {
00067   Clear();
00068   ClearInterruptMaskRegister();
00069   DisableInterrupt();
00070   return DisableInterruptOutput();
00071 }
00072 
00073 Tint TCamacInterruptRegisterModule::ReadInterruptRegister()
00074 {
00075   // in case of Read(), disable LAM after execution.
00076   return execute( 1, tCamacRead );
00077 }
00078 
00079 Tint TCamacInterruptRegisterModule::ReadInterruptMaskRegister()
00080 {
00081   return execute( 0, 1 );
00082 }
00083 
00084 Tint TCamacInterruptRegisterModule::ClearInterruptMaskRegister()
00085 {
00086   return execute( 0, 11 );
00087 }
00088 
00089 Tint TCamacInterruptRegisterModule::WriteInterruptMaskRegister( Tint data )
00090 {
00091   theCamacData = (TUint)data;
00092   return execute( 0, 17 );
00093 }
00094 
00095 Tint TCamacInterruptRegisterModule::ClearInterruptRegister()
00096 {
00097   // enable LAM execution
00098   return execute( 0, 21 );
00099 }
00100 
00101 Tint TCamacInterruptRegisterModule::DisableInterruptOutput()
00102 {
00103   return execute( 0, tCamacEnableInterrupt );
00104 }
00105 
00106 Tint TCamacInterruptRegisterModule::EnableInterruptOutput()
00107 {
00108   return execute( 0, tCamacDisableInterrupt );
00109 }
00110 
00111 #ifdef __CLDAQ_ROOT_DLL
00112     ClassImp(TCamacInterruptRegisterModule)
00113 #endif


CLDAQ - a Class Library for DataAcQuisition (Version 1.14.3)
Go IWAI -- goiwai at users.sourceforge.jp