Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
DccOutput Class Referenceabstract

Virtual base class for controlling outputs. More...

#include <DccOutput.hxx>

Inheritance diagram for DccOutput:
DccOutputImpl< HW >

Public Types

enum  Type : int { TRACK = 1 , PGM = 2 , LCC = 3 }
 Enumeration describing different outputs. More...
 
enum class  DisableReason : uint8_t {
  INITIALIZATION_PENDING = 0x01 , CONFIG_SETTING = 0x02 , LOCAL_DISABLE = CONFIG_SETTING , GLOBAL_EOFF = 0x04 ,
  SHORTED = 0x08 , THERMAL = 0x10 , PGM_TRACK_LOCKOUT = 0x20 , INVALID_SIGNAL_INPUT = 0x40 ,
  USR1 = 0x80
}
 Values of a bit mask why we might want to disable a given DCC output. More...
 
enum class  RailcomCutout { DISABLED = 0 , SHORT_CUTOUT = 1 , LONG_CUTOUT = 2 }
 Defines the values for the railcom cutout enabled setting. More...
 

Public Member Functions

virtual void disable_output_for_reason (DisableReason bit)=0
 Disables the output, marking in a bitmask why.
 
virtual void clear_disable_output_for_reason (DisableReason bit)=0
 Removes a disable reason flag.
 
void override_disable_bit_for_reason (DisableReason bit, bool value)
 Sets or clears a disable reason.
 
virtual uint8_t get_disable_output_reasons ()=0
 
virtual void set_railcom_cutout_enabled (RailcomCutout cutout)=0
 Specifies whether there should be a railcom cutout on this output.
 

Detailed Description

Virtual base class for controlling outputs.

All of these functions are okay to call from interrupts (including non-kernel-compatible interrupts under FreeRTOS).

Definition at line 45 of file DccOutput.hxx.

Member Enumeration Documentation

◆ DisableReason

enum class DccOutput::DisableReason : uint8_t
strong

Values of a bit mask why we might want to disable a given DCC output.

Enumerator
INITIALIZATION_PENDING 

Set as 1 during construction time, to be cleared by the application when the initialization is complete.

CONFIG_SETTING 

User decided via a persistent configuration that this output should not be enabled.

Mutually exclusive with LOCAL_DISABLE.

LOCAL_DISABLE 

A local request for disabling the output.

Mutually exclusive with CONFIG_SETTING.

GLOBAL_EOFF 

A network message requested global emergency off.

SHORTED 

Short detector says this output is shorted.

THERMAL 

The system is in thermal shutdown.

PGM_TRACK_LOCKOUT 

This output should be off due to the conflict between program track and normal operation mode.

INVALID_SIGNAL_INPUT 

invalid incoming DCC signal

USR1 

Reserved for application specific use cases.

Definition at line 60 of file DccOutput.hxx.

◆ RailcomCutout

enum class DccOutput::RailcomCutout
strong

Defines the values for the railcom cutout enabled setting.

Enumerator
DISABLED 

Generate no railcom cutout.

SHORT_CUTOUT 

Generate short cutout (ch1 only).

LONG_CUTOUT 

Generate long cutout (standard size; ch1+ch2).

Definition at line 113 of file DccOutput.hxx.

◆ Type

enum DccOutput::Type : int

Enumeration describing different outputs.

Enumerator
TRACK 

DCC output of the integrated booster.

PGM 

DCC output of the program track.

LCC 

DCC output going towards the LCC cable.

Definition at line 49 of file DccOutput.hxx.

Member Function Documentation

◆ clear_disable_output_for_reason()

virtual void DccOutput::clear_disable_output_for_reason ( DisableReason  bit)
pure virtual

Removes a disable reason flag.

All the flags need to be cleared in order to enable the output.

Implemented in DccOutputImpl< HW >.

◆ disable_output_for_reason()

virtual void DccOutput::disable_output_for_reason ( DisableReason  bit)
pure virtual

Disables the output, marking in a bitmask why.

Implemented in DccOutputImpl< HW >.

◆ get_disable_output_reasons()

virtual uint8_t DccOutput::get_disable_output_reasons ( )
pure virtual
Returns
Bitmask of all currently set disable reasons.

Implemented in DccOutputImpl< HW >.

◆ override_disable_bit_for_reason()

void DccOutput::override_disable_bit_for_reason ( DisableReason  bit,
bool  value 
)
inline

Sets or clears a disable reason.

Parameters
bitthe disable reason
valueif true, bit set to disable output, if false, bit cleared to not disable output.

Definition at line 97 of file DccOutput.hxx.

◆ set_railcom_cutout_enabled()

virtual void DccOutput::set_railcom_cutout_enabled ( RailcomCutout  cutout)
pure virtual

Specifies whether there should be a railcom cutout on this output.

Implemented in DccOutputImpl< HW >.


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