claraty::DIO_null Class Reference
#include <composite_digital_io.h>
Inheritance diagram for claraty::DIO_null:


Public Member Functions | |
| DIO_null (size_t n_bits) | |
| int | input () |
| int | output () |
| int | output (unsigned long data) |
| DIO_impl & | set_mask (unsigned long mask) |
| void | set_IO_direction (char *dir_str) |
| void | invert_IO (bool val=true) |
| std::string | to_str () const |
| void | print (const char *msg="") const |
Protected Attributes | |
| Bits | _data_bits |
| Bits | _mask_bits |
| int | _invert_signal |
Detailed Description
Definition at line 92 of file composite_digital_io.h.
Constructor & Destructor Documentation
| claraty::DIO_null::DIO_null | ( | size_t | n_bits | ) |
Definition at line 316 of file composite_digital_io.cc.
References claraty::DIO_impl::set_IO_direction().
00317 : DIO_impl(n_bits) 00318 { 00319 set_IO_direction("B"); 00320 }
Here is the call graph for this function:

Member Function Documentation
| int claraty::DIO_null::input | ( | ) | [inline, virtual] |
| int claraty::DIO_null::output | ( | ) | [inline, virtual] |
| int claraty::DIO_null::output | ( | unsigned long | data | ) | [inline, virtual] |
| DIO_impl & claraty::DIO_impl::set_mask | ( | unsigned long | mask | ) | [inherited] |
Definition at line 80 of file digital_io_impl.cc.
References claraty::DIO_impl::_mask_bits, and claraty::Bits::unchecked_set().
00081 { 00082 _mask_bits.unchecked_set (mask); // for effciency 00083 00084 return *this; 00085 }
Here is the call graph for this function:

| void claraty::DIO_impl::set_IO_direction | ( | char * | dir_str | ) | [inherited] |
Definition at line 87 of file digital_io_impl.cc.
References claraty::DIO_impl::_input_bits, claraty::DIO_impl::_output_bits, claraty::Bits::clr(), claraty::Bits::set(), and claraty::Bits::set_bit().
Referenced by claraty::DIO_impl::DIO_impl(), and DIO_null().
00088 { 00089 // Setting I/O direction for all bits: B = bi-directional for all bits 00090 // I = input for all bits 00091 // O = output for all bits 00092 // 00093 // Setting I/O direction for each bit 00094 // e.g., "BBIO" for 4 bits where rightmost character is bit 0 or LSB 00095 // 00096 // b = input bit 00097 // i = input bit 00098 // o = input bit 00099 // x = neither input nor output 00100 // 00101 00102 int len = strlen(dir_str); 00103 00104 00105 if (len == 1) { 00106 switch (dir_str[0]) { 00107 case 'B': 00108 _input_bits.set(); 00109 _output_bits.set(); 00110 return; 00111 case 'I': 00112 _input_bits.set(); 00113 _output_bits.clr(); 00114 return; 00115 case 'O': 00116 _input_bits.clr(); 00117 _output_bits.set(); 00118 return; 00119 } 00120 } 00121 00122 00123 _input_bits.clr(); 00124 _output_bits.clr(); 00125 00126 for (int i=0; i < len; ++i) { 00127 // start with the last character for bit 0 or LSB 00128 // 00129 switch (dir_str[len-i-1]) { 00130 case 'b': 00131 _input_bits.set_bit(i); 00132 _output_bits.set_bit(i); 00133 break; 00134 case 'i': 00135 _input_bits.set_bit(i); 00136 break; 00137 case 'o': 00138 _output_bits.set_bit(i); 00139 break; 00140 case 'x': 00141 break; 00142 default: 00143 cerr << "invalid argument DIO_impl::set_IO_direction" << endl; 00144 } // switch 00145 } // for i 00146 }
Here is the call graph for this function:

| void claraty::DIO_impl::invert_IO | ( | bool | val = true |
) | [inherited] |
Definition at line 149 of file digital_io_impl.cc.
References claraty::DIO_impl::_invert_signal.
00150 { 00151 // default: invert_signal 00152 // 00153 00154 _invert_signal = val; 00155 }
| string claraty::DIO_impl::to_str | ( | ) | const [inherited] |
Definition at line 158 of file digital_io_impl.cc.
References claraty::DIO_impl::_data_bits, and claraty::Bits::to_str().
00159 { 00160 return _data_bits.to_str(); 00161 }
Here is the call graph for this function:

| void claraty::DIO_impl::print | ( | const char * | msg = "" |
) | const [inherited] |
Definition at line 164 of file digital_io_impl.cc.
References claraty::DIO_impl::_data_bits, and claraty::Bits::print().
00165 { 00166 _data_bits.print(msg); 00167 }
Here is the call graph for this function:

Member Data Documentation
Bits claraty::DIO_impl::_data_bits [protected, inherited] |
Definition at line 72 of file digital_io_impl.h.
Referenced by claraty::DIO::clr(), claraty::DIO::clr_bit(), claraty::DIO_sim::input(), claraty::DIO::operator unsigned long(), claraty::DIO_sim::output(), claraty::DIO_impl::print(), claraty::DIO::set(), claraty::DIO::set_bit(), claraty::DIO::test(), claraty::DIO_impl::to_str(), claraty::DIO::toggle(), and claraty::DIO::toggle_bit().
Bits claraty::DIO_impl::_mask_bits [protected, inherited] |
Definition at line 73 of file digital_io_impl.h.
Referenced by claraty::DIO::input(), claraty::DIO::output(), and claraty::DIO_impl::set_mask().
int claraty::DIO_impl::_invert_signal [protected, inherited] |
Definition at line 74 of file digital_io_impl.h.
Referenced by claraty::DIO::DIO(), claraty::DIO_sim::input(), claraty::DIO_impl::invert_IO(), claraty::DIO::operator unsigned long(), and claraty::DIO_sim::output().
The documentation for this class was generated from the following files: