LCC Fusion Project 1.0
LCC Automation
Loading...
Searching...
No Matches
Lamp Class Reference

Lamp object. More...

#include <SignalLamp.h>

Inherits ConfigUpdateListener, and Blinking.

Public Types

enum  LampID : uint8_t
 Possible LED selections.
 
enum  LampPhase : uint8_t
 Possible LED phases.
 

Public Member Functions

 Lamp (const LampConfig &cfg, PWM *const *pins, const uint8_t size, const uint8_t cardNum)
 
void factory_reset (int fd) OVERRIDE
 
UpdateAction apply_configuration (int fd, bool initial_load, BarrierNotifiable *done) override
 Invoked on initial load of CDI and when CDI is udpated.
Register configured events with OpenMRN. More...
 
void On ()
 sets lamp pin state on
 
void Off ()
 sets lamp pin state off
 
virtual void blink (bool AFast, bool AMedium, bool ASlow)
 blinker callback that controls lamp blinking
 

Detailed Description

Lamp object.

Definition at line 79 of file SignalLamp.h.

Constructor & Destructor Documentation

◆ Lamp()

Lamp::Lamp ( const LampConfig &  cfg,
PWM *const *  pins,
const uint8_t  size,
const uint8_t  cardNum 
)
inline

Lamp object for signaling

Parameters
cfgCDI configuration offset to Lamp information
pinsis the list of pins represented by the Gpio* object instances. Can be constant from FLASH space.
sizeis the length of the list of pins array.
cardNumis the I/O card number, starting at 0

Definition at line 115 of file SignalLamp.h.

Member Function Documentation

◆ apply_configuration()

UpdateAction Lamp::apply_configuration ( int  fd,
bool  initial_load,
BarrierNotifiable *  done 
)
inlineoverride

Invoked on initial load of CDI and when CDI is udpated.
Register configured events with OpenMRN.

Parameters
fdfile descriptor used to access CDI data
initial_loadis true when CDI is loaded after a reboot
done

Definition at line 150 of file SignalLamp.h.

◆ factory_reset()

void Lamp::factory_reset ( int  fd)
inline

Reset CDI configuration entries to their initial (default) values

Parameters
fdused to access the CDI information in the file system

Definition at line 135 of file SignalLamp.h.


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