cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
osaDigitalInput1394.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5  Author(s): Zihan Chen, Peter Kazanzides, Jonathan Bohren
6  Created on: 2011-06-10
7 
8  (C) Copyright 2011-2014 Johns Hopkins University (JHU), All Rights Reserved.
9 
10 --- begin cisst license - do not edit ---
11 
12 This software is provided "as is" under an open source license, with
13 no warranty. The complete license can be found in license.txt and
14 http://www.cisst.org/cisst/license.txt.
15 
16 --- end cisst license ---
17 */
18 
19 #ifndef _osaDigitalInput1394_h
20 #define _osaDigitalInput1394_h
21 
23 #include "AmpIO.h"
24 
25 namespace sawRobotIO1394 {
26 
28  public:
30 
31  void Configure(const osaDigitalInput1394Configuration & config);
32  void SetBoard(AmpIO * board);
33 
34  void PollState(void);
35 
37 
38  const std::string & Name(void) const;
39  const bool & Value(void) const;
40  const bool & PreviousValue(void) const;
41 
42  protected:
43  AmpIO * mBoard; // Board Assignment
44 
46  std::string mName;
47  int mBitID; // Board assigned bitID for this Digital Input
48  AmpIO_UInt32 mBitMask; // BitMask for this input. From DigitalInput Stream.
49  bool mPressedValue; // Boolean Flag for Active High(true)/Active Low(false)
50  bool mTriggerPress; // Boolean Flag for Press Trigger Setting
51  bool mTriggerRelease; // Boolean Flag for Release Trigger Setting
52  double mDebounceThreshold; // 0, no debounce required otherwise time in seconds
53 
54  // ZC: hysteresis
56  double mTestLow;
57  double mTestHigh;
58  double mTestWeight;
59 
60  // State data
61  AmpIO_UInt32 mDigitalInputBits; // BitMask for this input. From DigitalInput Stream.
62  bool mValue; // Current read value
63  bool mTransitionValue; // For debouncing
64  bool mPreviousValue; // Saved value from the previous read
65  double mDebounceCounter; // time in seconds with constant value
66  };
67 
68 }
69 
70 #endif // _osaDigitalInput1394_h
double mTestHigh
Definition: osaDigitalInput1394.h:57
bool mValue
Definition: osaDigitalInput1394.h:62
void Configure(const osaDigitalInput1394Configuration &config)
bool mTriggerRelease
Definition: osaDigitalInput1394.h:51
const bool & Value(void) const
bool mTransitionValue
Definition: osaDigitalInput1394.h:63
Definition: osaConfiguration1394.h:124
const osaDigitalInput1394Configuration & Configuration(void) const
const bool & PreviousValue(void) const
double mTestConfidence
Definition: osaDigitalInput1394.h:55
osaDigitalInput1394(const osaDigitalInput1394Configuration &config)
AmpIO_UInt32 mDigitalInputBits
Definition: osaDigitalInput1394.h:61
AmpIO * mBoard
Definition: osaDigitalInput1394.h:43
bool mPreviousValue
Definition: osaDigitalInput1394.h:64
double mTestLow
Definition: osaDigitalInput1394.h:56
double mDebounceThreshold
Definition: osaDigitalInput1394.h:52
Definition: osaDigitalInput1394.h:27
const std::string & Name(void) const
osaDigitalInput1394Configuration mConfiguration
Definition: osaDigitalInput1394.h:45
int mBitID
Definition: osaDigitalInput1394.h:47
double mDebounceCounter
Definition: osaDigitalInput1394.h:65
std::string mName
Definition: osaDigitalInput1394.h:46
AmpIO_UInt32 mBitMask
Definition: osaDigitalInput1394.h:48
double mTestWeight
Definition: osaDigitalInput1394.h:58
bool mPressedValue
Definition: osaDigitalInput1394.h:49
bool mTriggerPress
Definition: osaDigitalInput1394.h:50