LCC Fusion Project 1.0
LCC Automation
Loading...
Searching...
No Matches
Node Card Firmware

Firmware for the LCC Fusion Node Card. More...

Files

file  BsdConfiguredProducer.h
 Producer class for BSD (Block Short Detection) cards.
 
file  DefaultDeviceSettings.h
 Provides supporting class for saving and restoring the initial state of card settings for use by producer/consumer classes.
 
file  I2cCardHelper.h
 Common support for I²C-based card producers/consumers: registration, CDI helpers, ID queries, I²C init, and a default consumer handler that routes to drive_pin/drive_pin_ext.
 
file  I2cPollingHelper.h
 Opt‑in polling engine for producers (header‑only).
 
file  LccNode.h
 Instantiates the LCC Node object that provides access to all Node specific functions (wrapper around OpenMRN and OpenMRNLite)
 
file  LccNodeAlerts.h
 Provides Node Card alerting and self-monitoring services.
 
file  LccNodeCardConfig.h
 Supports user define configuration; number of sound cards and players to configure, Node communications and Node ID.
 
file  LccNodeCardPins.h
 Supports user define configuration; number of sound cards and players to configure, Node communications and Node ID.
 
file  LccNodeCardRegistry.h
 Manages a registry of IO cards and their information. Invoked by producer/consumers when being instantiated.
 
file  LccNodeCdi.h
 Provide CDI definition.
 
file  LccNodeCommons.h
 Provides supporting classes for defining card producer/consumer classes.
 
file  LccNodeConfig.h
 Supports user define configuration; number of sound cards and players to configure, Node communications and Node ID.
 
file  LccNodeFactoryReset.h
 Handle reseting of the Node specific information back to factory settings.
 
file  LccNodeI2c.h
 Handle I2C connections to remote I2C enabled devices.
 
file  LccNodeIdManager.h
 Manages LCC NodeID with support for various formats.
 
file  LccNodeMacros.h
 Macros used in support of generating consumer and producer objects.
 
file  LccNodeMenu.h
 
file  LccNodeMri.h
 
file  LccNodeNowBridge.h
 ESP_NOW to GridConnect Bridge for processing GC packets between ESP_NOW (ESP32 wireless) and GridConnect.
 
file  LccNodePC.h
 Instantiates the consumer and producer related object(s) For each of the producer / consumer classes, add a section below to invoke the class. Use #define controls to control whether or not to instantiate a class. Provides a means to control the amount of memory being consumed for various configurations.
 
file  LccNodePCcdi.h
 Defines the main CDI elements for all consumers.
 
file  LccNodePersistentStorageManager.h
 Instantiates the LCC Node Persistent Storage Manager that handles LCC Node information in SPIFFs.
 
file  LccNodeSerialMonitor.h
 Provides serial, Bluetooth, and WebSerial console monitoring for an LCC Node.
 
file  LccNodeSlcanSerialBridge.h
 Bridge for translating and forwarding CAN frames between GridConnect and Slcan serial formats.
 
file  LccNodeUtils.h
 LccNode library functions.
 
file  LccNodeVars.h
 
file  Logics.cpp
 
file  Logics.h
 
file  NeoPixelConfiguredConsumer.h
 Consumer class for LCC Node Card NeoPixel outputs.
 
file  NodeCardIoConfiguredPC.h
 Manages up to 8 configurable I/O lines for a Node Card, supporting direct or breakout board connections.
 
file  ServoConfiguredConsumer.h
 LCC consumer for controlling servos via one or more Servo Cards.
 
file  SignalLamp.h
 
file  SignalMast.cpp
 
file  SignalMast.h
 
file  SignalRule.cpp
 
file  SignalRule.h
 
file  SignalTrackCircuit.cpp
 
file  SignalTrackCircuit.h
 
file  SoundConfiguredConsumer.h
 Consumer class that uses CDI configuration to support generating I2C messages based on LCC events received.
Supports connecting sound devices (DFPlayer MP3 devices) either locally to the LCC Node HW or remotely using I2C.
For remote I2C connections, a Sound Card device running an ESP32 is required, which acts as an I2C master device. The I2C (text) messages are received by a Sound Card's ESP32, which then uses local UART serial to send commands to the player device.
 
file  SoundPlayerDevice.h
 Process request to a DFPlayer (mp3) device connected using software serial UART or I2C.
 
file  TurnoutConfiguredPC.h
 Manages turnout control and status for one or more Turnout Cards using an I2C MCP23017 expander.
 
file  UOD_Card.ino
 ESP32 UOD Card firmware: I2C slave that reports a 2-byte sensor bitmap and accepts per-sensor range config.
 

Classes

class  LccNodePowerMonitor
 Monitors voltage and current for up to two Power-CAN Cards using ADS1115 ADCs. More...
 

Functions

 CDI_GROUP (AlexaVoiceDeviceEventConfig, Name(alexaVoiceCdiMri::EVENT_GROUP_DESC_TEXT))
 Supports CDI-based configuration for mapping Alexa voice commands to LCC events. More...
 
 CDI_GROUP (AudioMessageGroupConfig, Name(audioCdiMri::MESSAGE_GROUP_NAME_TEXT), Description(audioCdiMri::MESSAGE_GROUP_DESC_TEXT))
 LCC consumer for user-defined event-triggered audio playback via Audio Cards. More...
 
 CDI_GROUP (IoLineConfig)
 Producer-consumer class for MCP23017-based I/O Cards and IO Breakout Boards. More...
 
 CDI_GROUP (EventIdViewerConfig, Name(eventIdViewerCdiMri::GROUP_NAME_TEXT), Description(eventIdViewerCdiMri::GROUP_DESC_TEXT))
 Monitors a range of LCC Event IDs and outputs event information to the serial port. More...
 

Variables

LccNode lccNode (COMM_TYPES::CAN_TWAI|COMM_TYPES::CAN_SLCAN_SERIAL_BRIDGE)
 instantiates all consumer and producers
 

Detailed Description

Firmware for the LCC Fusion Node Card.

High-level overview and links to the main entry points (setup/loop) and helper functions used by the Node Card firmware.

Function Documentation

◆ CDI_GROUP() [1/4]

CDI_GROUP ( AlexaVoiceDeviceEventConfig  ,
Name(alexaVoiceCdiMri::EVENT_GROUP_DESC_TEXT)   
)

Supports CDI-based configuration for mapping Alexa voice commands to LCC events.

Copyright (c) 2023, Pat Fleming

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Defines the AlexaVoiceConfiguredProducer class, which allows users to configure multiple Alexa voice commands, each associated with one or more device names and event sets. When an Alexa command is received, the class produces the corresponding LCC events for integration with the Node Card system. Enables flexible, voice-activated automation using Amazon Alexa and LCC Event mapping.

Author
Pat Fleming
Date
01-26-2023
Here is the caller graph for this function:

◆ CDI_GROUP() [2/4]

CDI_GROUP ( AudioMessageGroupConfig  ,
Name(audioCdiMri::MESSAGE_GROUP_NAME_TEXT)  ,
Description(audioCdiMri::MESSAGE_GROUP_DESC_TEXT)   
)

LCC consumer for user-defined event-triggered audio playback via Audio Cards.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Defines the AudioConfiguredConsumer class, which uses CDI configuration to associate user-defined events and text messages with audio playback actions. When a configured event is received, the class sends an I2C message to an Audio Card specifying the DAC device number and the message text. The Audio Card's ESP32 then converts the message text to audio and plays it through the appropriate device using I2S audio output. Enables flexible, event-driven voice or sound playback integration with the Node Card system.

Author
Pat Fleming
Date
July 14 2024 CDI Configuration for the AudioConfiguredConsumer class

◆ CDI_GROUP() [3/4]

CDI_GROUP ( EventIdViewerConfig  ,
Name(eventIdViewerCdiMri::GROUP_NAME_TEXT)  ,
Description(eventIdViewerCdiMri::GROUP_DESC_TEXT)   
)

Monitors a range of LCC Event IDs and outputs event information to the serial port.

Copyright (c) 2023, Pat Fleming

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Defines the LccNodeEventIdViewer class, which listens for LCC/OpenLCB events within a specified range of Event IDs and reports event details to the serial console. Useful for debugging, monitoring, and verifying event activity on the LCC network in real time.

Author
Pat Fleming
Date
01-26-2024 CDI Configuration for the
See also
LccNodeEventIdViewer class

◆ CDI_GROUP() [4/4]

CDI_GROUP ( IoLineConfig  )

Producer-consumer class for MCP23017-based I/O Cards and IO Breakout Boards.

Copyright (c) 2023, Pat Fleming

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Defines the IoConfiguredPC class, which provides CDI-based configuration and management of multiple GPIO pins on MCP23017 I/O Cards, supporting both input and output modes. Each pin can be individually configured to produce or consume LCC events, enabling flexible automation, monitoring, and control of devices such as sensors, switches, LEDs, relays, and more through direct connection or via IO Breakout Boards.

Author
Pat Fleming
Date
01-26-2023 CDI Configuration for a IoConfiguredPC.