Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
RailcomDriver.hxx
Go to the documentation of this file.
1
36#ifndef _FREERTOS_DRIVERS_COMMON_RAILCOMDRIVER_HXX_
37#define _FREERTOS_DRIVERS_COMMON_RAILCOMDRIVER_HXX_
38
39#include <inttypes.h>
40
41#include "utils/macros.h"
42#include "dcc/railcom.h"
43
49public:
54 virtual void feedback_sample() = 0;
57 virtual void start_cutout() = 0;
62 virtual void middle_cutout() = 0;
65 virtual void end_cutout() = 0;
68 virtual void no_cutout() = 0;
74 virtual void set_feedback_key(uint32_t key) = 0;
75
82 virtual void send_ch1(const DCCFeedback *ch1_pkt)
83 {
84 }
85
92 virtual void send_ch2(const DCCFeedback *ch2_pkt)
93 {
94 }
95};
96
97
108
109#endif // _FREERTOS_DRIVERS_COMMON_RAILCOMDRIVER_HXX_
Empty implementation of the railcom driver for boards that have no railcom hardware.
void end_cutout() OVERRIDE
Instructs the driver that the railcom cutout is over now.
void start_cutout() OVERRIDE
Instructs the driver that the railcom cutout is starting now.
void feedback_sample() OVERRIDE
Call to the driver for sampling the current sensors.
void middle_cutout() OVERRIDE
Notifies the driver that the railcom cutout has reached the middle point, i.e., the first window is p...
void no_cutout() OVERRIDE
Called instead of start/mid/end-cutout at the end of the current packet if there was no cutout reques...
void set_feedback_key(uint32_t key) OVERRIDE
Specifies the feedback key to write into the received railcom data packets.
Abstract base class for railcom drivers.
virtual void send_ch2(const DCCFeedback *ch2_pkt)
Specifies what packet should be sent for the channel2 cutout.
virtual void middle_cutout()=0
Notifies the driver that the railcom cutout has reached the middle point, i.e., the first window is p...
virtual void set_feedback_key(uint32_t key)=0
Specifies the feedback key to write into the received railcom data packets.
virtual void end_cutout()=0
Instructs the driver that the railcom cutout is over now.
virtual void send_ch1(const DCCFeedback *ch1_pkt)
Specifies what packet should be sent for the channel1 cutout.
virtual void start_cutout()=0
Instructs the driver that the railcom cutout is starting now.
virtual void feedback_sample()=0
Call to the driver for sampling the current sensors.
virtual void no_cutout()=0
Called instead of start/mid/end-cutout at the end of the current packet if there was no cutout reques...
#define OVERRIDE
Function attribute for virtual functions declaring that this funciton is overriding a funciton that s...
Definition macros.h:180