ClearCore Library
|
Base class for interacting with all ClearCore connector objects.
This virtual class defines the common functionality for a connector object.
It provides a generic interface that all connectors have. This includes
For more detailed information on the ClearCore Connector interface, check out the ClearCore Connector System informational page.
Base class for interacting with all ClearCore connector objects. More...
#include <Connector.h>
Public Types | |
enum | ConnectorModes { INVALID_NONE , INPUT_ANALOG , INPUT_DIGITAL , OUTPUT_ANALOG , OUTPUT_DIGITAL , OUTPUT_H_BRIDGE , OUTPUT_PWM , OUTPUT_TONE , OUTPUT_WAVE , CPM_MODE_A_DIRECT_B_DIRECT , CPM_MODE_STEP_AND_DIR , CPM_MODE_A_DIRECT_B_PWM , CPM_MODE_A_PWM_B_PWM , TTL , RS232 , SPI , CCIO , USB_CDC } |
All possible operational modes for a connector. More... | |
enum | ConnectorTypes { DIGITAL_IN_TYPE , DIGITAL_IN_OUT_TYPE , SHIFT_REG_TYPE , ANALOG_IN_DIGITAL_IN_TYPE , ANALOG_OUT_DIGITAL_IN_OUT_TYPE , H_BRIDGE_TYPE , CPM_TYPE , SERIAL_TYPE , SERIAL_USB_TYPE , CCIO_DIGITAL_IN_OUT_TYPE } |
The different types of ClearCore connectors. More... | |
Public Member Functions | |
virtual ConnectorModes | Mode () |
Get the connector's operational mode. | |
virtual bool | Mode (ConnectorModes newMode)=0 |
Set the connector's operational mode. | |
virtual ConnectorTypes | Type ()=0 |
Get the connector type. | |
virtual bool | IsWritable ()=0 |
Determine whether values can be written to this connector. | |
void | Reinitialize () |
Reinitialize this connector to the power-up state. | |
int32_t | ConnectorIndex () |
Accessor for the bit index of this connector in the input register. | |
virtual int16_t | State ()=0 |
Get the connector's last sampled value. | |
virtual bool | State (int16_t newState)=0 |
Set the state of a R/W connector. | |
virtual bool | IsInHwFault ()=0 |
Get whether the connector is in a hardware fault state. | |
uint32_t | InputRegMask () |
Get a bit mask representing this connector. | |
All possible operational modes for a connector.
The different types of ClearCore connectors.
Enumerator | |
---|---|
DIGITAL_IN_TYPE | [0] Digital input connector. This connector has the following features:
Connectors of this type:
|
DIGITAL_IN_OUT_TYPE | [1] Digital input/output connector. This connector has the following features:
Connectors of this type:
|
SHIFT_REG_TYPE | [2] Virtual connector to access LED and configuration shift register |
ANALOG_IN_DIGITAL_IN_TYPE | [3] Analog and digital input connector. This connector supports the following features:
Connectors of this type:
|
ANALOG_OUT_DIGITAL_IN_OUT_TYPE | [4] Digital input/output and analog output connector. This connector supports the following features:
Connectors of this type:
|
H_BRIDGE_TYPE | [5] H-Bridge connector. Utilizing V+ and IO pin as a pair these connectors can be setup to:
Connectors of this type:
|
CPM_TYPE | [6] ClearPath™ motor connector. This connector can control a ClearPath™ motor. Some of the control abilities available include:
Connectors of this type:
|
SERIAL_TYPE | [7] Serial port connector. These connectors can:
Connectors of this type:
|
SERIAL_USB_TYPE | [8] Serial USB connector. These connectors can:
Connectors of this type:
|
CCIO_DIGITAL_IN_OUT_TYPE | [9] ClearCore I/O Expansion Board digital I/O connector. This connector has the following features:
|
|
inline |
Accessor for the bit index of this connector in the input register.
|
inline |
Get a bit mask representing this connector.
|
pure virtual |
Get whether the connector is in a hardware fault state.
Implemented in ClearCore::CcioPin, ClearCore::DigitalInOut, and ClearCore::MotorDriver.
|
pure virtual |
Determine whether values can be written to this connector.
Implemented in ClearCore::CcioPin, ClearCore::DigitalIn, ClearCore::DigitalInAnalogIn, ClearCore::DigitalInOut, ClearCore::DigitalInOutAnalogOut, ClearCore::DigitalInOutHBridge, ClearCore::LedDriver, ClearCore::MotorDriver, ClearCore::SerialDriver, and ClearCore::SerialUsb.
|
inlinevirtual |
Get the connector's operational mode.
Reimplemented in ClearCore::CcioPin, ClearCore::DigitalIn, ClearCore::DigitalInAnalogIn, ClearCore::DigitalInOut, ClearCore::DigitalInOutAnalogOut, ClearCore::DigitalInOutHBridge, ClearCore::MotorDriver, ClearCore::SerialDriver, and ClearCore::SerialUsb.
|
pure virtual |
Set the connector's operational mode.
[in] | newMode | The new mode to be set. |
Implemented in ClearCore::CcioPin, ClearCore::DigitalIn, ClearCore::DigitalInAnalogIn, ClearCore::DigitalInOut, ClearCore::DigitalInOutAnalogOut, ClearCore::DigitalInOutHBridge, ClearCore::SerialDriver, and ClearCore::SerialUsb.
|
inline |
Reinitialize this connector to the power-up state.
|
pure virtual |
Get the connector's last sampled value.
Return the current "value" for this connector. For connectors with more than one input or output the value returned here would depend on the specific connector. Access to this information would need to be provided by the implementation object.
For boolean items, this will return the values of C++ true and false. For analog items, this could be the RAW or processed ADC value, etc.
Implemented in ClearCore::CcioPin, ClearCore::DigitalIn, ClearCore::DigitalInAnalogIn, ClearCore::DigitalInOut, ClearCore::DigitalInOutAnalogOut, ClearCore::DigitalInOutHBridge, and ClearCore::LedDriver.
|
pure virtual |
Set the state of a R/W connector.
For read-write objects, this allows you to change the state of the connector item.
[in] | newState | For mutable items, update the output. |
Implemented in ClearCore::CcioPin, ClearCore::DigitalInOut, ClearCore::DigitalInOutAnalogOut, ClearCore::DigitalInOutHBridge, and ClearCore::LedDriver.
|
pure virtual |
Get the connector type.
Implemented in ClearCore::CcioPin, ClearCore::DigitalIn, ClearCore::DigitalInAnalogIn, ClearCore::DigitalInOut, ClearCore::DigitalInOutAnalogOut, ClearCore::DigitalInOutHBridge, ClearCore::LedDriver, ClearCore::MotorDriver, ClearCore::SerialDriver, and ClearCore::SerialUsb.