Cat
Public Member Functions | List of all members
SpecsGlue Class Reference

#include <inc/SpecsGlue.h>

Inheritance diagram for SpecsGlue:
SpecsSlave SpecsInterface Interface Element Hierarchy Object Attrib

Public Member Functions

 SpecsGlue ()
 Standard constructor. More...
 
virtual ~SpecsGlue ()
 Standard Destructor. More...
 
void help ()
 
bool led ()
 
int date ()
 
void setLed (bool)
 
void setI2cClkMode (int)
 
int i2cClkMode ()
 
- Public Member Functions inherited from SpecsSlave
 SpecsSlave ()
 
 ~SpecsSlave ()
 
void addI2c (Hierarchy *)
 
void setAddress (unsigned char)
 
SPECSSLAVE * specsSlaveDevice ()
 
bool detect ()
 
StatusCode init ()
 
void recursiveInitCommunications ()
 
void resetInternal ()
 
void reset ()
 
- Public Member Functions inherited from SpecsInterface
 SpecsInterface ()
 
virtual ~SpecsInterface ()
 
virtual void update ()
 
void setAddress (unsigned char)
 
unsigned char address ()
 
void setOutputSelect (unsigned char)
 
unsigned char outputSelect ()
 
virtual SpecsSlavespecsSlave ()
 
virtual SpecsMasterspecsMaster ()
 
virtual SPECSMASTER * specsMasterDevice ()
 
virtual StatusCode read (IOdata *io)
 
virtual StatusCode write (IOdata *io)
 
bool specsWriteI2c (unsigned char address, unsigned char nData, U8 *data)
 
bool specsWriteI2c (unsigned char address, std::vector< U8 > data)
 
bool specsReadI2c (unsigned char address, unsigned char nOctects, U8 *i2cWords)
 
bool specsReadI2c (unsigned char address, std::vector< unsigned char > &specsWords)
 
bool specsWriteI2c (unsigned char address, unsigned char subAddress, unsigned char nData, U8 *data)
 
bool specsWriteI2c (unsigned char address, unsigned char outputSel, unsigned char subAddress, unsigned char nData, U8 *data)
 
bool specsReadI2c (unsigned char address, unsigned char subAddress, unsigned char nOctets, U8 *i2cWords)
 
bool specsReadI2c (unsigned char address, unsigned char outputSel, unsigned char subAddress, unsigned char nOctets, U8 *i2cWords)
 
bool specsWriteParallel (unsigned char address, unsigned short data)
 
bool specsReadParallel (unsigned char address, U16 &data)
 
bool specsWriteRegister (unsigned char, unsigned short)
 
bool specsReadRegister (unsigned char, U16 &)
 
- Public Member Functions inherited from Interface
 Interface ()
 Standard constructor. More...
 
virtual ~Interface ()
 Destructor. More...
 
- Public Member Functions inherited from Element
 Element ()
 Standard constructor. More...
 
virtual ~Element ()
 Destructor. More...
 
void recursiveInitElement ()
 
void recursiveInitCommunications ()
 
StatusCode setConnection (Hierarchy *)
 
Hierarchyconnection ()
 
- Public Member Functions inherited from Hierarchy
 Hierarchy ()
 Standard constructor. More...
 
virtual ~Hierarchy ()
 Destructor. More...
 
void clear ()
 
void setParent (Hierarchy *parent)
 
Hierarchyparent ()
 
Hierarchyparent (std::string)
 
Hierarchyorigin ()
 
virtual void addChild (Hierarchy *element)
 
std::vector< Hierarchy * > children ()
 
Hierarchychild (std::string)
 
HierarchychildTyped (std::string)
 
unsigned long numberOfChildren ()
 
bool hasChildren ()
 
void delChild (Hierarchy *)
 
void delChild (std::string)
 
std::string path (std::string=std::string(""))
 
std::string pathTyped (std::string=std::string(""))
 
void tree (std::string indent=std::string(""))
 
void tree ()
 
- Public Member Functions inherited from Object
 Object ()
 Standard constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string name () const
 
std::string type ()
 
unsigned char id ()
 
std::string title ()
 
void msgSvc (int level, std::string msg, std::string name)
 
void msg (std::string mymsg)
 
void verbose (std::string mymsg)
 
void debug (std::string mymsg)
 
void info (std::string mymsg)
 
void warning (std::string mymsg)
 
void error (std::string mymsg)
 
void fatal (std::string mymsg)
 
void msg (std::string mymsg, std::string name)
 
void verbose (std::string mymsg, std::string name)
 
void debug (std::string mymsg, std::string name)
 
void info (std::string mymsg, std::string name)
 
void warning (std::string mymsg, std::string name)
 
void error (std::string mymsg, std::string name)
 
void fatal (std::string mymsg, std::string name)
 
void setName (std::string name)
 
void setType (std::string type)
 
void setId (unsigned char id)
 
void setTitle (std::string title)
 
void setDllName (std::string dllName)
 
std::string dllName ()
 
- Public Member Functions inherited from Attrib
 Attrib ()
 Standard constructor. More...
 
virtual ~Attrib ()
 Destructor. More...
 
bool is (int attribut)
 
void add (int attribut)
 
void remove (int attribut)
 
std::string attributs ()
 

Additional Inherited Members

- Public Types inherited from Attrib
enum  Attribut {
  UNDEFINED, PASSIVE, ACTIVE, INTERFACE,
  IO, IODATA, ELEMENT, HARDWARE,
  PROCESSUS, SOFTWARE
}
 
- Protected Attributes inherited from SpecsSlave
SpecsI2ci2c
 
- Protected Attributes inherited from SpecsInterface
unsigned char m_address
 
unsigned char m_outputSelect
 
- Protected Attributes inherited from Element
Hierarchym_connection
 
- Protected Attributes inherited from Attrib
std::string m_attribString [10]
 

Detailed Description

Author
Frédéric Machefert
Date
2005-05-25

Definition at line 15 of file SpecsGlue.h.

Constructor & Destructor Documentation

◆ SpecsGlue()

SpecsGlue::SpecsGlue ( )

Standard constructor.

Definition at line 21 of file SpecsGlue.cpp.

References SpecsSlave::setAddress(), Object::setName(), and Object::setType().

21  {
22  setAddress(0x0);
23  setName("SpecsGlue");
24  setType("SpecsGlue");
25 }
void setName(std::string name)
Definition: Object.h:51
void setType(std::string type)
Definition: Object.h:52
void setAddress(unsigned char)
Definition: SpecsSlave.cpp:50

◆ ~SpecsGlue()

SpecsGlue::~SpecsGlue ( )
virtual

Standard Destructor.

Destructor

Definition at line 30 of file SpecsGlue.cpp.

30 {}

Member Function Documentation

◆ date()

int SpecsGlue::date ( )

Get the Specs Slave Date

Definition at line 158 of file SpecsGlue.cpp.

References SpecsInterface::specsReadRegister(), and Object::warning().

158  {
159  unsigned char reg = 8 ;
160 #ifndef _NODEVICE_
161  U16 val;
162  this -> specsReadRegister( reg , val );
163  val = (val&0xFF00)*100+(val&0xFF);
164  return val;
165 #else
166  warning("" , "Compilation in _NoDevice_ mode." );
167 #endif
168  return 0;
169 }
unsigned short U16
Definition: ICECALv3.h:54
void warning(std::string mymsg)
Definition: Object.h:39
bool specsReadRegister(unsigned char, U16 &)

◆ help()

void SpecsGlue::help ( )
virtual

Help message for the Specs Slaves

Reimplemented from SpecsInterface.

Definition at line 143 of file SpecsGlue.cpp.

References Object::info().

143  {
144  info("SpecsGlue","Specs Glue Element help");
145  info("","");
146  info("","Address # : set slave address at #");
147  info("","Reset : reset of the slave");
148  info("","ResetInternal : internal reset of the slave");
149  info("","RegWrite #0 #1 : write register #0 with value #1");
150  info("","RegRead #0 #1 : read register #");
151 
152  info( "","");
153 }
void info(std::string mymsg)
Definition: Object.h:38

◆ i2cClkMode()

int SpecsGlue::i2cClkMode ( )

Definition at line 241 of file SpecsGlue.cpp.

References Object::debug(), SpecsInterface::specsReadRegister(), and Object::warning().

241  {
242  unsigned char reg = 4 ;
243 #ifndef _NODEVICE_
244  U16 val ;
245  this -> specsReadRegister( reg , val );
246  if ( 0 != ( val & 0x0004 ) ){
247  debug("SpecsGlue::led","Glue I2C Mode Clk idle 0");
248  return 1;
249  }
250 #else
251  warning("" , "Compilation in _NoDevice_ mode." );
252  return 0;
253 #endif
254  debug("SpecsGlue::led","Glue I2C Mode Clk idle 1");
255  return 0;
256 }
void debug(std::string mymsg)
Definition: Object.h:37
unsigned short U16
Definition: ICECALv3.h:54
void warning(std::string mymsg)
Definition: Object.h:39
bool specsReadRegister(unsigned char, U16 &)

◆ led()

bool SpecsGlue::led ( )

Get the state of the LEDs controlled by the Specs Slave

Definition at line 197 of file SpecsGlue.cpp.

References Object::debug(), SpecsInterface::specsReadRegister(), and Object::warning().

197  {
198  unsigned char reg = 4 ;
199 #ifndef _NODEVICE_
200  U16 val ;
201  this -> specsReadRegister( reg , val );
202  if ( 0 != ( val & 0x0008 ) ){
203  debug("SpecsGlue::led","Glue LEDs are OFF");
204  return false;
205  }
206 #else
207  warning("" , "Compilation in _NoDevice_ mode." );
208  return true;
209 #endif
210  debug("SpecsGlue::led","Glue LEDs are ON");
211  return true;
212 }
void debug(std::string mymsg)
Definition: Object.h:37
unsigned short U16
Definition: ICECALv3.h:54
void warning(std::string mymsg)
Definition: Object.h:39
bool specsReadRegister(unsigned char, U16 &)

◆ setI2cClkMode()

void SpecsGlue::setI2cClkMode ( int  mode)

Definition at line 217 of file SpecsGlue.cpp.

References Object::debug(), SpecsInterface::specsReadRegister(), SpecsInterface::specsWriteRegister(), and Object::warning().

217  {
218  unsigned char reg = 4 ;
219 #ifndef _NODEVICE_
220  U16 val;
221  this -> specsReadRegister( reg , val );
222  if ( 0==mode ) {
223  val = ( val & 0xFFFB ) ;
224  this -> specsWriteRegister(reg, val );
225  debug("SpecsGlue::led","setting Glue I2C Mode Clk idle 1");
226  }
227  else {
228  val = ( val | 0x0004 ) ;
229  this -> specsWriteRegister(reg , val ) ;
230  debug("SpecsGlue::led","setting Glue I2C Mode Clk idle 0");
231  }
232 #else
233  warning("" , "Compilation in _NoDevice_ mode." );
234 #endif
235 }
bool specsWriteRegister(unsigned char, unsigned short)
void debug(std::string mymsg)
Definition: Object.h:37
unsigned short U16
Definition: ICECALv3.h:54
void warning(std::string mymsg)
Definition: Object.h:39
bool specsReadRegister(unsigned char, U16 &)

◆ setLed()

void SpecsGlue::setLed ( bool  state)

Set the state of the LEDs controlled by the Specs Slave

Definition at line 174 of file SpecsGlue.cpp.

References Object::debug(), SpecsInterface::specsReadRegister(), and SpecsInterface::specsWriteRegister().

174  {
175  unsigned char reg = 4 ;
176 #ifndef _NODEVICE_
177  U16 val;
178  this -> specsReadRegister( reg , val );
179  if ( state ) {
180  val = ( val & 0xFFF7 ) ;
181  this -> specsWriteRegister(reg, val );
182  debug("SpecsGlue::led","setting Glue LEDs On");
183  }
184  else {
185  val = ( val | 0x0008 ) ;
186  this -> specsWriteRegister(reg , val ) ;
187  debug("SpecsGlue::led","setting Glue LEDs OFF");
188  }
189 #else
190  debug("" , "Compilation in _NoDevice_ mode." );
191 #endif
192 }
bool specsWriteRegister(unsigned char, unsigned short)
void debug(std::string mymsg)
Definition: Object.h:37
unsigned short U16
Definition: ICECALv3.h:54
bool specsReadRegister(unsigned char, U16 &)

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