ClearCore Library
Loading...
Searching...
No Matches
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.
 
bool IsWritable () override
 Get R/W status of the connector.
 
int16_t State () override
 Get LED's last sampled state.
 
bool State (int16_t newState) override
 Set the state of the LED.
 
- Public Member Functions inherited from ClearCore::Connector
virtual ConnectorModes Mode ()
 Get the connector's operational mode.
 
virtual bool Mode (ConnectorModes newMode)=0
 Set the connector's operational mode.
 
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 bool IsInHwFault ()=0
 Get whether the connector is in a hardware fault state.
 
uint32_t InputRegMask ()
 Get a bit mask representing this connector.
 

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

◆ IsWritable()

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.

◆ State() [1/2]

int16_t ClearCore::LedDriver::State ( )
overridevirtual

Get LED's last sampled state.

// The built-in LED is on
}
int16_t State() override
Get LED's last sampled state.
LedDriver ConnectorLed
User-driven LED instance.
Returns
The latest LED state.

Implements ClearCore::Connector.

Examples
DigitalIOExamples/InputInterrupts/InputInterrupts.cpp, DigitalIOExamples/PeriodicInterrupt/PeriodicInterrupt.cpp, InputInterrupts.cpp, and PeriodicInterrupt.cpp.

◆ State() [2/2]

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.

◆ Type()

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

Get connector type.

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

Implements ClearCore::Connector.


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