|
Open Model Railroad Network (OpenMRN)
|
Abstract base class for railcom drivers. More...
#include <RailcomDriver.hxx>
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. | |
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.
|
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 >.
|
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 >.
|
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 >.
|
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 >.
|
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.
| ch1_pkt | the 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.
|
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.
| ch2_pkt | the 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.
|
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.
| key | is the new feedback key. |
Implemented in RailcomDriverBase< HW >, NoRailcomDriver, RailcomDriverBase< HW >, and Stm32RailcomSender.
|
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 >.