Class to control a simulated digital input or output.
More...
#include <frc/simulation/DIOSim.h>
Class to control a simulated digital input or output.
◆ DIOSim() [1/3]
◆ DIOSim() [2/3]
◆ DIOSim() [3/3]
frc::sim::DIOSim::DIOSim |
( |
int |
channel | ) |
|
|
explicit |
Constructs from an digital I/O channel number.
- Parameters
-
◆ GetFilterIndex()
int frc::sim::DIOSim::GetFilterIndex |
( |
| ) |
const |
Read the filter index.
- Returns
- the filter index of this DIO port
◆ GetInitialized()
bool frc::sim::DIOSim::GetInitialized |
( |
| ) |
const |
Check whether this DIO has been initialized.
- Returns
- true if initialized
◆ GetIsInput()
bool frc::sim::DIOSim::GetIsInput |
( |
| ) |
const |
Check whether this DIO port is currently an Input.
- Returns
- true if Input
◆ GetPulseLength()
double frc::sim::DIOSim::GetPulseLength |
( |
| ) |
const |
Read the pulse length.
- Returns
- the pulse length of this DIO port
◆ GetValue()
bool frc::sim::DIOSim::GetValue |
( |
| ) |
const |
Read the value of the DIO port.
- Returns
- the DIO value
◆ RegisterFilterIndexCallback()
Register a callback to be run whenever the filter index changes.
- Parameters
-
callback | the callback |
initialNotify | whether the callback should be called with the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterInitializedCallback()
Register a callback to be run when this DIO is initialized.
- Parameters
-
callback | the callback |
initialNotify | whether to run the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterIsInputCallback()
Register a callback to be run whenever this DIO changes to be an input.
- Parameters
-
callback | the callback |
initialNotify | whether the callback should be called with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterPulseLengthCallback()
Register a callback to be run whenever the pulse length changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterValueCallback()
Register a callback to be run whenever the DIO value changes.
- Parameters
-
callback | the callback |
initialNotify | whether the callback should be called with the initial value |
- Returns
- the CallbackStore object associated with this callback
◆ ResetData()
void frc::sim::DIOSim::ResetData |
( |
| ) |
|
Reset all simulation data of this object.
◆ SetFilterIndex()
void frc::sim::DIOSim::SetFilterIndex |
( |
int |
filterIndex | ) |
|
Change the filter index of this DIO port.
- Parameters
-
filterIndex | the new filter index |
◆ SetInitialized()
void frc::sim::DIOSim::SetInitialized |
( |
bool |
initialized | ) |
|
Define whether this DIO has been initialized.
- Parameters
-
initialized | whether this object is initialized |
◆ SetIsInput()
void frc::sim::DIOSim::SetIsInput |
( |
bool |
isInput | ) |
|
Define whether this DIO port is an Input.
- Parameters
-
isInput | whether this DIO should be an Input |
◆ SetPulseLength()
void frc::sim::DIOSim::SetPulseLength |
( |
double |
pulseLength | ) |
|
Change the pulse length of this DIO port.
- Parameters
-
pulseLength | the new pulse length |
◆ SetValue()
void frc::sim::DIOSim::SetValue |
( |
bool |
value | ) |
|
Change the DIO value.
- Parameters
-
The documentation for this class was generated from the following file: