|
Open Model Railroad Network (OpenMRN)
|
Railcom driver for TI Tiva-class microcontrollers using the TivaWare peripheral library. More...
#include <Railcom.hxx>
Public Member Functions | |
| TivaRailcomDriver (const char *path) | |
| Constructor. | |
| TivaRailcomDriver (const char *path) | |
| Constructor. | |
Public Member Functions inherited from RailcomDriverBase< HW > | |
| RailcomDriverBase (const char *name) | |
| Constructor. | |
| void | os_interrupt_handler () |
| Implementation of the interrupt handler running at the kernel interrupt priority. | |
| RailcomDriverBase (const char *name) | |
| Constructor. | |
| void | os_interrupt_handler () |
| Implementation of the interrupt handler running at the kernel interrupt priority. | |
Public Member Functions inherited from RailcomDriver | |
| 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. | |
Private Member Functions | |
| void | enable () OVERRIDE |
| This will be called once when reference-count goes from 0 to positive. | |
| void | disable () OVERRIDE |
| This will be called when reference count goes from non-zero to 0. | |
| void | feedback_sample () OVERRIDE |
| Call to the driver for sampling the current sensors. | |
| void | start_cutout () OVERRIDE |
| Instructs the driver that the railcom cutout is starting now. | |
| void | middle_cutout () OVERRIDE |
| 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. | |
| void | end_cutout () OVERRIDE |
| Instructs the driver that the railcom cutout is over now. | |
| void | no_cutout () OVERRIDE |
| Called instead of start/mid/end-cutout at the end of the current packet if there was no cutout requested. | |
| void | int_set_pending (unsigned int_nr) override |
| Sets a given software interrupt pending. | |
| void | enable () OVERRIDE |
| This will be called once when reference-count goes from 0 to positive. | |
| void | disable () OVERRIDE |
| This will be called when reference count goes from non-zero to 0. | |
| void | feedback_sample () OVERRIDE |
| Call to the driver for sampling the current sensors. | |
| void | start_cutout () OVERRIDE |
| Instructs the driver that the railcom cutout is starting now. | |
| void | middle_cutout () OVERRIDE |
| 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. | |
| void | end_cutout () OVERRIDE |
| Instructs the driver that the railcom cutout is over now. | |
| void | no_cutout () OVERRIDE |
| Called instead of start/mid/end-cutout at the end of the current packet if there was no cutout requested. | |
Private Attributes | |
| bool | inCutout_ = false |
| True when we are currently within a cutout. | |
Additional Inherited Members | |
Protected Member Functions inherited from RailcomDriverBase< HW > | |
| dcc::Feedback * | alloc_new_packet (uint8_t channel) |
| Takes a new empty packet at the front of the queue, fills in feedback key and channel information. | |
| void | add_sample (int sample) |
| Adds a sample for a preamble bit. | |
| dcc::Feedback * | alloc_new_packet (uint8_t channel) |
| Takes a new empty packet at the front of the queue, fills in feedback key and channel information. | |
| void | add_sample (int sample) |
| Adds a sample for a preamble bit. | |
Protected Attributes inherited from RailcomDriverBase< HW > | |
| Notifiable * | readableNotifiable_ |
| Notify this when we have data in our buffers. | |
| FixedQueue< dcc::Feedback, HW::Q_SIZE > | feedbackQueue_ |
| The packets we have read so far. | |
| uint32_t | feedbackKey_ |
| Stores the key for the next packets to read. | |
| dcc::Feedback * | returnedPackets_ [HW::CHANNEL_COUNT] |
| Stores pointers to packets we are filling right now, one for each channel. | |
Railcom driver for TI Tiva-class microcontrollers using the TivaWare peripheral library.
This railcom driver supports parallel polling of multiple UART channels for the railcom data.
Definition at line 293 of file Railcom.hxx.
|
inline |
Constructor.
| path | is the device node path (e.g. "/dev/railcom0"). |
Definition at line 297 of file Railcom.hxx.
|
inline |
Constructor.
| path | is the device node path (e.g. "/dev/railcom0"). |
Definition at line 133 of file TivaRailcom.hxx.
|
inline |
Definition at line 140 of file TivaRailcom.hxx.
|
inlineprivatevirtual |
This will be called when reference count goes from non-zero to 0.
Called with lock_ held.
Implements Node.
Definition at line 325 of file Railcom.hxx.
|
inlineprivatevirtual |
This will be called when reference count goes from non-zero to 0.
Called with lock_ held.
Implements Node.
Definition at line 177 of file TivaRailcom.hxx.
|
inlineprivatevirtual |
This will be called once when reference-count goes from 0 to positive.
Called with lock_ held.
Implements Node.
Definition at line 307 of file Railcom.hxx.
|
inlineprivatevirtual |
This will be called once when reference-count goes from 0 to positive.
Called with lock_ held.
Implements Node.
Definition at line 159 of file TivaRailcom.hxx.
|
inlineprivatevirtual |
Instructs the driver that the railcom cutout is over now.
The driver will use this information to disable the UART receiver.
Implements RailcomDriver.
Definition at line 401 of file Railcom.hxx.
|
inlineprivatevirtual |
Instructs the driver that the railcom cutout is over now.
The driver will use this information to disable the UART receiver.
Implements RailcomDriver.
Definition at line 253 of file TivaRailcom.hxx.
|
inlineprivatevirtual |
Call to the driver for sampling the current sensors.
This call is performed repeatedly, in a configurable interval, on the next positive edge.
Implements RailcomDriver.
Definition at line 334 of file Railcom.hxx.
|
inlineprivatevirtual |
Call to the driver for sampling the current sensors.
This call is performed repeatedly, in a configurable interval, on the next positive edge.
Implements RailcomDriver.
Definition at line 186 of file TivaRailcom.hxx.
|
inlineoverrideprivatevirtual |
Sets a given software interrupt pending.
| int_nr | interrupt number (will be HW::OS_INTERRUPT) |
Implements RailcomDriverBase< HW >.
Definition at line 153 of file TivaRailcom.hxx.
|
inlineprivatevirtual |
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.
Implements RailcomDriver.
Definition at line 361 of file Railcom.hxx.
|
inlineprivatevirtual |
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.
Implements RailcomDriver.
Definition at line 213 of file TivaRailcom.hxx.
|
inlineprivatevirtual |
Called instead of start/mid/end-cutout at the end of the current packet if there was no cutout requested.
Implements RailcomDriver.
Definition at line 458 of file Railcom.hxx.
|
inlineprivatevirtual |
Called instead of start/mid/end-cutout at the end of the current packet if there was no cutout requested.
Implements RailcomDriver.
Definition at line 310 of file TivaRailcom.hxx.
|
inlineprivatevirtual |
Instructs the driver that the railcom cutout is starting now.
The driver will use this information to enable the UART receiver.
Implements RailcomDriver.
Definition at line 340 of file Railcom.hxx.
|
inlineprivatevirtual |
Instructs the driver that the railcom cutout is starting now.
The driver will use this information to enable the UART receiver.
Implements RailcomDriver.
Definition at line 192 of file TivaRailcom.hxx.
|
private |
True when we are currently within a cutout.
Definition at line 303 of file Railcom.hxx.