Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
dcc::Dcc128Payload Struct Reference

Structure defining the volatile state for a 128-speed-step DCC locomotive. More...

#include <Loco.hxx>

Inheritance diagram for dcc::Dcc128Payload:
dcc::DccPayloadBase

Public Member Functions

void add_dcc_speed_to_packet (dcc::Packet *p)
 Adds the speed payload to a DCC packet.
 
void add_dcc_estop_to_packet (dcc::Packet *p)
 Adds the speed payload to a DCC packet with value == EMERGENCY_STOP.
 
- Public Member Functions inherited from dcc::DccPayloadBase
void set_fn_store (unsigned idx, bool value)
 Set a given function bit in storage.
 
bool get_fn_store (unsigned idx)
 Get a given function bit in storage.
 
TrainAddressType get_address_type ()
 

Static Public Member Functions

static unsigned get_speed_steps ()
 
- Static Public Member Functions inherited from dcc::DccPayloadBase
static unsigned get_max_fn ()
 
static unsigned get_fn_update_code (unsigned address)
 

Additional Inherited Members

- Public Attributes inherited from dcc::DccPayloadBase
uint16_t address_: 14
 Track address. largest address allowed is 10239.
 
uint16_t isShortAddress_: 1
 1 if this is a short address train.
 
uint16_t direction_: 1
 0: forward, 1: reverse
 
uint16_t lastSetSpeed_: 16
 fp16 value of the last set speed.
 
unsigned fn_: 29
 functions f0-f28.
 
uint8_t nextRefresh_: 3
 Which refresh packet should go out next.
 
uint8_t isEstop_: 1
 1 if the last speed set was estop.
 
uint8_t directionChanged_: 1
 Whether the direction change packet still needs to go out.
 
uint8_t f0SetDirectional_: 1
 1 if the F0 function should be set/get in a directional way.
 
uint8_t f0OnForward_: 1
 1 if directional f0 is used and f0 is on for F.
 
uint8_t f0OnReverse_: 1
 1 if directional f0 is used and f0 is on for R.
 
uint8_t f0BlankForward_: 1
 1 if F0 should be turned off when dir==forward.
 
uint8_t f0BlankReverse_: 1
 1 if F0 should be turned off when dir==reverse.
 
uint8_t speed_: 7
 Speed step we last set.
 
uint8_t fhi_ [5]
 f29-f68 state.
 

Detailed Description

Structure defining the volatile state for a 128-speed-step DCC locomotive.

Definition at line 523 of file Loco.hxx.

Constructor & Destructor Documentation

◆ Dcc128Payload()

dcc::Dcc128Payload::Dcc128Payload ( )
inline

Definition at line 525 of file Loco.hxx.

Member Function Documentation

◆ add_dcc_estop_to_packet()

void dcc::Dcc128Payload::add_dcc_estop_to_packet ( dcc::Packet p)
inline

Adds the speed payload to a DCC packet with value == EMERGENCY_STOP.

Parameters
pis the packet to add the speed payload to.

Definition at line 545 of file Loco.hxx.

◆ add_dcc_speed_to_packet()

void dcc::Dcc128Payload::add_dcc_speed_to_packet ( dcc::Packet p)
inline

Adds the speed payload to a DCC packet.

Parameters
pis the packet to add the speed payload to.

Definition at line 538 of file Loco.hxx.

◆ get_speed_steps()

static unsigned dcc::Dcc128Payload::get_speed_steps ( )
inlinestatic
Returns
the number of speed steps (the largest valid speed step).

Definition at line 531 of file Loco.hxx.


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