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

Abstract base class for railcom drivers. More...

#include <RailcomDriver.hxx>

Inheritance diagram for RailcomDriver:
NoRailcomDriver RailcomDriverBase< HW > RailcomDriverBase< HW > Stm32RailcomSender Stm32RailcomDriver< HW > TivaRailcomDriver< HW > TivaRailcomDriver< HW > Stm32RailcomDriver< HW > TivaRailcomDriver< HW > TivaRailcomDriver< HW >

Public Member Functions

virtual void feedback_sample ()=0
 Call to the driver for sampling the current sensors.
 
virtual void start_cutout ()=0
 Instructs the driver that the railcom cutout is starting now.
 
virtual void middle_cutout ()=0
 Notifies the driver that the railcom cutout has reached the middle point, i.e., the first window is passed and the second window is starting.
 
virtual void end_cutout ()=0
 Instructs the driver that the railcom cutout is over now.
 
virtual void no_cutout ()=0
 Called instead of start/mid/end-cutout at the end of the current packet if there was no cutout requested.
 
virtual void set_feedback_key (uint32_t key)=0
 Specifies the feedback key to write into the received railcom data packets.
 
virtual void send_ch1 (const DCCFeedback *ch1_pkt)
 Specifies what packet should be sent for the channel1 cutout.
 
virtual void send_ch2 (const DCCFeedback *ch2_pkt)
 Specifies what packet should be sent for the channel2 cutout.
 

Detailed Description

Abstract base class for railcom drivers.

This interface is used to communicate when the railcom cutout happens. The railcom cutout is produced or detected in the DCC generator or DCC parser driver, but the railcom drivers need to adjust the UART configuration in accordance with it.

Definition at line 48 of file RailcomDriver.hxx.

Member Function Documentation

◆ end_cutout()

virtual void RailcomDriver::end_cutout ( )
pure virtual

Instructs the driver that the railcom cutout is over now.

The driver will use this information to disable the UART receiver.

Implemented in TivaRailcomDriver< HW >, NoRailcomDriver, Stm32RailcomDriver< HW >, Stm32RailcomSender, and TivaRailcomDriver< HW >.

◆ feedback_sample()

virtual void RailcomDriver::feedback_sample ( )
pure virtual

Call to the driver for sampling the current sensors.

This call is performed repeatedly, in a configurable interval, on the next positive edge.

Implemented in TivaRailcomDriver< HW >, NoRailcomDriver, Stm32RailcomDriver< HW >, Stm32RailcomSender, and TivaRailcomDriver< HW >.

◆ middle_cutout()

virtual void RailcomDriver::middle_cutout ( )
pure virtual

Notifies the driver that the railcom cutout has reached the middle point, i.e., the first window is passed and the second window is starting.

The driver will use this information to separate channel 1 nd channel 2 data.

Implemented in TivaRailcomDriver< HW >, NoRailcomDriver, Stm32RailcomDriver< HW >, Stm32RailcomSender, and TivaRailcomDriver< HW >.

◆ no_cutout()

virtual void RailcomDriver::no_cutout ( )
pure virtual

Called instead of start/mid/end-cutout at the end of the current packet if there was no cutout requested.

Implemented in TivaRailcomDriver< HW >, NoRailcomDriver, Stm32RailcomDriver< HW >, Stm32RailcomSender, and TivaRailcomDriver< HW >.

◆ send_ch1()

virtual void RailcomDriver::send_ch1 ( const DCCFeedback ch1_pkt)
inlinevirtual

Specifies what packet should be sent for the channel1 cutout.

It is okay to specify the same packet pointer for ch1 and ch2 cutout.

Parameters
ch1_pktthe RailCom packet. Only the ch1 data will be read from this packet. This pointer must stay alive until the next DCC packet comes. The FeedbackKey in this packet must be correct for the current DCC packet or else the data will not be sent.

Reimplemented in Stm32RailcomSender.

Definition at line 82 of file RailcomDriver.hxx.

◆ send_ch2()

virtual void RailcomDriver::send_ch2 ( const DCCFeedback ch2_pkt)
inlinevirtual

Specifies what packet should be sent for the channel2 cutout.

It is okay to specify the same packet pointer for ch1 and ch2 cutout.

Parameters
ch2_pktthe RailCom packet. Only the ch2 data will be read from this packet. This pointer must stay alive until the next DCC packet comes. The FeedbackKey in this packet must be correct for the current DCC packet or else the data will not be sent.

Reimplemented in Stm32RailcomSender.

Definition at line 92 of file RailcomDriver.hxx.

◆ set_feedback_key()

virtual void RailcomDriver::set_feedback_key ( uint32_t  key)
pure virtual

Specifies the feedback key to write into the received railcom data packets.

This feedback key is used by the application layer to correlate the stream of DCC packets to the stream of Railcom packets. This method shall be called before start_cutout. The feedback key set here is used until this method is called again.

Parameters
keyis the new feedback key.

Implemented in RailcomDriverBase< HW >, NoRailcomDriver, RailcomDriverBase< HW >, and Stm32RailcomSender.

◆ start_cutout()

virtual void RailcomDriver::start_cutout ( )
pure virtual

Instructs the driver that the railcom cutout is starting now.

The driver will use this information to enable the UART receiver.

Implemented in TivaRailcomDriver< HW >, NoRailcomDriver, Stm32RailcomDriver< HW >, Stm32RailcomSender, and TivaRailcomDriver< HW >.


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