ClearCore Library
List of all members | Public Member Functions
ClearCore::LedDriver Class Reference

Detailed Description

ClearCore LED control class.

This class manages access to the LED shift register so LEDs may be controlled at the connector level.

ClearCore LED control class. More...

#include <LedDriver.h>

+ Inheritance diagram for ClearCore::LedDriver:
+ Collaboration diagram for ClearCore::LedDriver:

Public Member Functions

Connector::ConnectorTypes Type () override
 Get connector type. More...
 
bool IsWritable () override
 Get R/W status of the connector. More...
 
int16_t State () override
 Get LED's last sampled state. More...
 
bool State (int16_t newState) override
 Set the state of the LED. More...
 
- Public Member Functions inherited from ClearCore::Connector
virtual ConnectorModes Mode ()
 Get the connector's operational mode. More...
 
virtual bool Mode (ConnectorModes newMode)=0
 Set the connector's operational mode. More...
 
void Reinitialize ()
 Reinitialize this connector to the power-up state. More...
 
int32_t ConnectorIndex ()
 Accessor for the bit index of this connector in the input register. More...
 
virtual bool IsInHwFault ()=0
 Get whether the connector is in a hardware fault state. More...
 
uint32_t InputRegMask ()
 Get a bit mask representing this connector. More...
 

Additional Inherited Members

- Public Types inherited from ClearCore::Connector
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...
 

Member Function Documentation

bool ClearCore::LedDriver::IsWritable ( )
inlineoverridevirtual

Get R/W status of the connector.

if (ConnectorAlias.IsWritable()) {
// This generic connector variable is writable
}
Returns
True because this connector is always writable.

Implements ClearCore::Connector.

int16_t ClearCore::LedDriver::State ( )
overridevirtual

Get LED's last sampled state.

// The built-in LED is on
}
Returns
The latest LED state.

Implements ClearCore::Connector.

Examples:
DigitalIOExamples/InputInterrupts/InputInterrupts.cpp, and DigitalIOExamples/PeriodicInterrupt/PeriodicInterrupt.cpp.
bool ClearCore::LedDriver::State ( int16_t  newState)
overridevirtual

Set the state of the LED.

// Turn on the built-in LED
Parameters
[in]newStateNew state to set for the LED.

Implements ClearCore::Connector.

Connector::ConnectorTypes ClearCore::LedDriver::Type ( )
inlineoverridevirtual

Get connector type.

if (ConnectorAlias.Type() == Connector::SHIFT_REG_TYPE) {
// This generic connector variable is the LedDriver
}
Returns
The type of the current connector.

Implements ClearCore::Connector.


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