ClearCore Library
Loading...
Searching...
No Matches
List of all members | Classes | Public Member Functions
ClearCore::StatusManager Class Reference

Detailed Description

ClearCore Status Register Manager class.

This class manages access to ClearCore status information.

ClearCore Status Register Manager class. More...

#include <StatusManager.h>

Classes

union  StatusRegister
 

Public Member Functions

StatusRegister StatusRT (StatusRegister mask=UINT32_MAX)
 The real time status register.
 
StatusRegister StatusRisen (StatusRegister mask=UINT32_MAX)
 Clear on read accessor for status bits that have risen (transitioned from deasserted to asserted) sometime since the previous invocation of this function.
 
StatusRegister StatusFallen (StatusRegister mask=UINT32_MAX)
 Clear on read accessor for status bits that have fallen (transitioned from asserted to deasserted) sometime since the previous invocation of this function.
 
StatusRegister StatusAccum (StatusRegister mask=UINT32_MAX)
 Accumulating Clear on read accessor for any status bits that were asserted sometime since the previous invocation of this function.
 
StatusRegister SinceStartupAccum (StatusRegister mask=UINT32_MAX)
 Access to all accumulated status bits that have asserted since board startup (or since the last board reset).
 
void BlinkCodeClear (uint8_t group, uint8_t code)
 
void HBridgeReset ()
 Starts a reset pulse to the DigitalInOutHBridge connectors.
 
bool AdcIsInTimeout ()
 Read accessor for whether the ADC has timed out while attempting a conversion.
 
SysConnectorState IoOverloadRT (SysConnectorState mask=UINT32_MAX)
 Accessor for the real time overload status of the I/O connectors.
 
SysConnectorState IoOverloadAccum (SysConnectorState mask=UINT32_MAX)
 Clear on read accessor for connector overload status since the last invocation of this function.
 
SysConnectorState IoOverloadSinceStartupAccum (SysConnectorState mask=UINT32_MAX)
 Accessor for connector overload status since startup (or board reset).
 
void UserBlinkCode (uint8_t mask)
 

Member Function Documentation

◆ AdcIsInTimeout()

bool ClearCore::StatusManager::AdcIsInTimeout ( )

Read accessor for whether the ADC has timed out while attempting a conversion.

// ADC has timed out.
}
bool AdcIsInTimeout()
Read accessor for whether the ADC has timed out while attempting a conversion.
StatusManager & StatusMgr
Status manager.
Returns
True if the ADC is currently timed out, false otherwise.

◆ BlinkCodeClear()

void ClearCore::StatusManager::BlinkCodeClear ( uint8_t  group,
uint8_t  code 
)
inline

Deactivate a blink code.

Clear out a currently active blink code. This is useful for when an error can be fixed on the fly, while the board is still operating, to avoid being continually alerted to the error even after it was resolved.

Parameters
[in]groupThe group number the blink code belongs to.
[in]codeThe blink code number to clear.
// Check for an historical overload on connector IO-0.
if (StatusMgr.IoOverloadAccum().bit.CLEARCORE_PIN_IO0) {
// Clear out the reporting of the overload (blink code 1-1)
}
void BlinkCodeClear(uint8_t group, uint8_t code)
Definition StatusManager.h:330
SysConnectorState IoOverloadAccum(SysConnectorState mask=UINT32_MAX)
Clear on read accessor for connector overload status since the last invocation of this function.
struct ClearCore::SysConnectorState::@6 bit

See ClearCore Status Blink Codes for group and code numbers.

◆ HBridgeReset()

void ClearCore::StatusManager::HBridgeReset ( )

Starts a reset pulse to the DigitalInOutHBridge connectors.

Resetting the HBridge will temporarily disable the DigitalInOutHBridge and MotorDriver connectors.

// Reset the HBridge connectors.
void HBridgeReset()
Starts a reset pulse to the DigitalInOutHBridge connectors.
Note
Any active step and direction moves on the MotorDriver connectors will be terminated.
Examples
DigitalIOExamples/WriteHBridgeOutput/WriteHBridgeOutput.cpp, and WriteHBridgeOutput.cpp.

◆ IoOverloadAccum()

SysConnectorState ClearCore::StatusManager::IoOverloadAccum ( SysConnectorState  mask = UINT32_MAX)

Clear on read accessor for connector overload status since the last invocation of this function.

// There has been a connector overload since the last call to
// IoOverloadAccum().
}
uint32_t reg
Definition SysConnectors.h:187
Parameters
[in]mask(optional) A SysConnectorState whose asserted bits indicate which of the ClearCore connector overload status bits to check for an asserted state. If one of the bit members of this mask are deasserted, that bit will be ignored when checking for connector overloads. If no mask is provided, it's equivalent to passing a SysConnectorState with all bits asserted, in which case this function would report any connectors in an overload state since the last invocation of this function.
Returns
SysConnectorState register whose asserted bits indicate which connectors have been overloaded since the last poll.

◆ IoOverloadRT()

SysConnectorState ClearCore::StatusManager::IoOverloadRT ( SysConnectorState  mask = UINT32_MAX)

Accessor for the real time overload status of the I/O connectors.

if (StatusMgr.IoOverloadRT().bit.CLEARCORE_PIN_IO3) {
// IO-3 is currently overloaded.
}
SysConnectorState IoOverloadRT(SysConnectorState mask=UINT32_MAX)
Accessor for the real time overload status of the I/O connectors.
Parameters
[in]mask(optional) A SysConnectorState whose asserted bits indicate which of the ClearCore connector overload status bits to check for an asserted state. If one of the bit members of this mask are deasserted, that bit will be ignored when checking for connector overloads. If no mask is provided, it's equivalent to passing a SysConnectorState with all bits asserted, in which case this function would report any connectors currently in an overloaded state.
Returns
SysConnectorState register whose asserted bits indicate which connectors are currently overloaded.

◆ IoOverloadSinceStartupAccum()

SysConnectorState ClearCore::StatusManager::IoOverloadSinceStartupAccum ( SysConnectorState  mask = UINT32_MAX)

Accessor for connector overload status since startup (or board reset).

if (StatusMgr.IoOverloadSinceStartupAccum().bit.CLEARCORE_PIN_IO3) {
// Connector IO-3 has overloaded since startup.
}
SysConnectorState IoOverloadSinceStartupAccum(SysConnectorState mask=UINT32_MAX)
Accessor for connector overload status since startup (or board reset).
if (StatusMgr.IoOverloadSinceStartupAccum().bit.CLEARCORE_PIN_IO2) {
// Connector IO-2 was overloaded since startup.
}
Parameters
[in]mask(optional) A SysConnectorState whose asserted bits indicate which of the ClearCore connector overload status bits to check for an asserted state. If one of the bit members of this mask are deasserted, that bit will be ignored when checking for connector overloads. If no mask is provided, it's equivalent to passing a SysConnectorState with all bits asserted, in which case this function would report any connectors that have been in an overload state since board startup.
Returns
SysConnectorState register whose asserted bits indicate which connectors have been overloaded since startup.

◆ SinceStartupAccum()

StatusRegister ClearCore::StatusManager::SinceStartupAccum ( StatusRegister  mask = UINT32_MAX)

Access to all accumulated status bits that have asserted since board startup (or since the last board reset).

Note
This is not a clear on read operation, so reading this register does not automatically clear out the bits that have been raised, unlike StatusRisen() and StatusFallen().
// See if any CCIO-8 link errors have occurred since startup.
bool ccioConnectionProb =
if (ccioConnectionProb) {
// The CCIO-8 link is broken; do something about it here.
}
StatusRegister SinceStartupAccum(StatusRegister mask=UINT32_MAX)
Access to all accumulated status bits that have asserted since board startup (or since the last board...
struct ClearCore::StatusManager::StatusRegister::@5 bit
uint32_t CcioLinkBroken
Definition StatusManager.h:95
Parameters
[in]mask(optional) A StatusRegister whose asserted bits indicate which of the ClearCore status bits to check for an asserted state. If one of the bit members of this mask are deasserted, that bit will be ignored when checking for asserted status bits. If no mask is provided, it's equivalent to passing a StatusRegister with all bits asserted, in which case this function would report any accumulated asserted status bits.
Returns
StatusRegister whose asserted bits indicate which ClearCore status bits have risen since startup.

◆ StatusAccum()

StatusRegister ClearCore::StatusManager::StatusAccum ( StatusRegister  mask = UINT32_MAX)

Accumulating Clear on read accessor for any status bits that were asserted sometime since the previous invocation of this function.

Note
This is similar to StatusRisen() except that it tracks asserted status bits rather than status bits that have transitioned from deasserted to asserted. Therefore in the case that the supply voltage has been low since startup, i.e. its status bit has been set since startup, calling this function repeatedly will show that bit asserted each time, while calling StatusRisen() repeatedly will only show the bit asserted on the first call, since it transitioned from deasserted to asserted only once at startup.
// See if any CCIO-8 link errors have occurred since the last call
bool ccioConnectionProb = StatusMgr.StatusAccum().bit.CcioLinkBroken;
if (ccioConnectionProb) {
// The CCIO-8 link is broken; do something about it here.
}
StatusRegister StatusAccum(StatusRegister mask=UINT32_MAX)
Accumulating Clear on read accessor for any status bits that were asserted sometime since the previou...
Parameters
[in]mask(optional) A StatusRegister whose asserted bits indicate which of the ClearCore status bits to check for an asserted state. If one of the bit members of this mask are deasserted, that bit will be ignored when checking for asserted status bits. If no mask is provided, it's equivalent to passing a StatusRegister with all bits asserted, in which case this function would report any accumulated asserted status bits.
Returns
StatusRegister whose asserted bits indicate which ClearCore status bits have been asserted since the last poll.

◆ StatusFallen()

StatusRegister ClearCore::StatusManager::StatusFallen ( StatusRegister  mask = UINT32_MAX)

Clear on read accessor for status bits that have fallen (transitioned from asserted to deasserted) sometime since the previous invocation of this function.

// Check if any power supply problems have gone away since the last call
if (fallen.reg) {
// Power supply problems have gone away since last call
}
StatusRegister StatusFallen(StatusRegister mask=UINT32_MAX)
Clear on read accessor for status bits that have fallen (transitioned from asserted to deasserted) so...
Definition StatusManager.h:47
uint32_t reg
Definition StatusManager.h:51
uint32_t VSupplyUnderVoltage
Definition StatusManager.h:66
uint32_t VSupplyOverVoltage
Definition StatusManager.h:61
Parameters
[in]mask(optional) A StatusRegister whose asserted bits indicate which of the ClearCore status bits to check for falling edges. If one of the bit members of this mask are deasserted, that bit will be ignored when checking for falling edges. If no mask is provided, it's equivalent to passing a StatusRegister with all bits asserted, in which case this function would report falling edges on any of the status bits.
Returns
StatusRegister whose asserted bits indicate which ClearCore status bits have fallen since the last poll.

◆ StatusRisen()

StatusRegister ClearCore::StatusManager::StatusRisen ( StatusRegister  mask = UINT32_MAX)

Clear on read accessor for status bits that have risen (transitioned from deasserted to asserted) sometime since the previous invocation of this function.

// Check if any power supply problems have occurred since the last call
if (risen.reg) {
// Power supply problems have occurred since last call.
}
StatusRegister StatusRisen(StatusRegister mask=UINT32_MAX)
Clear on read accessor for status bits that have risen (transitioned from deasserted to asserted) som...
Parameters
[in]mask(optional) A StatusRegister whose asserted bits indicate which of the ClearCore status bits to check for rising edges. If one of the bit members of this mask are deasserted, that bit will be ignored when checking for rising edges. If no mask is provided, it's equivalent to passing a StatusRegister with all bits asserted, in which case this function would report rising edges on any of the status bits.
Returns
StatusRegister whose asserted bits indicate which ClearCore status bits have risen since the last poll.

◆ StatusRT()

StatusRegister ClearCore::StatusManager::StatusRT ( StatusRegister  mask = UINT32_MAX)

The real time status register.

The bits that are asserted in the status register that's returned indicate events that are occurring now.

Note
This register shows a real-time view of the ClearCore's status. Some of the status bits contained within are of a transient nature and will not persist for multiple samples. This means that your polling of this register may miss certain status events. To catch these events poll the StatusRisen and StatusFallen registers.
// Save the current ADC timeout status as a bool.
bool adcTimedOut = StatusMgr.StatusRT().bit.AdcTimeout;
if (adcTimedOut) {
// The ADC has timed out.
}
StatusRegister StatusRT(StatusRegister mask=UINT32_MAX)
The real time status register.
uint32_t AdcTimeout
Definition StatusManager.h:99
Parameters
[in]mask(optional) A StatusRegister whose asserted bits indicate which of the ClearCore status bits to check for an asserted state. If one of the bit members of this mask are deasserted, that bit will be ignored when checking for asserted status bits. If no mask is provided, it's equivalent to passing a StatusRegister with all bits asserted, in which case this function would report any status bits that are currently asserted.
Returns
StatusRegister whose asserted bits indicate currently active ClearCore status events.
Examples
ClearCoreBoardStatus/ClearCoreStatusRegister/ClearCoreStatusRegister.cpp, ClearCoreStatusRegister.cpp, DigitalIOExamples/WriteHBridgeOutput/WriteHBridgeOutput.cpp, and WriteHBridgeOutput.cpp.

◆ UserBlinkCode()

void ClearCore::StatusManager::UserBlinkCode ( uint8_t  mask)
inline

Activate an application driven blink code.

This function allows the application code to display a blink code in the #BLINK_GROUP_APPLICATION code group.

// If an error code is present, display the corresponding blink code.
uint8_t errorCode = 3;
if (errorCode) {
StatusMgr.UserBlinkCode(1 << (errorCode-1));
}
void UserBlinkCode(uint8_t mask)
Definition StatusManager.h:477
Parameters
[in]maskA mask representing an aggregate of blink codes to display.

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