|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Library-internal wiring module for config facade. More...
Functions | |
| uint8_t | OpenLcb_get_global_100ms_tick (void) |
| Returns the current value of the global 100ms tick counter. | |
| void | OpenLcb_initialize (const openlcb_config_t *config) |
| Initializes the entire OpenLCB stack from the user configuration. | |
| openlcb_node_t * | OpenLcb_create_node (node_id_t node_id, const node_parameters_t *parameters) |
| Allocates a node slot and assigns its ID and parameters. | |
| void | OpenLcb_run (void) |
| Runs one iteration of all state machines and periodic services. | |
| void | OpenLcb_100ms_timer_tick (void) |
| Increments the global 100ms tick counter. This is the ONLY action performed by the timer interrupt — all real work runs in the main loop. | |
Library-internal wiring module for config facade.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
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.
Reads from openlcb_config_t and compile-time feature guards (OPENLCB_COMPILE_*), builds internal interface structs, and calls all Module_initialize() functions in the correct order.
| uint8_t OpenLcb_get_global_100ms_tick | ( | void | ) |
Returns the current value of the global 100ms tick counter.
Used by wiring code (openlcb_config.c, can_config.c) to read the clock and inject it into modules via parameters or interface function pointers. Individual modules should NOT call this directly — they receive the tick through their function parameters or interface.
| void OpenLcb_initialize | ( | const openlcb_config_t * | config | ) |
Initializes the entire OpenLCB stack from the user configuration.
Initializes the entire OpenLCB stack with one call.
Algorithm:
* @param config Pointer to the @ref openlcb_config_t to use *
| openlcb_node_t * OpenLcb_create_node | ( | node_id_t | node_id, |
| const node_parameters_t * | parameters ) |
Allocates a node slot and assigns its ID and parameters.
Allocates and registers a new node on the OpenLCB network.
* @param node_id Unique 48-bit @ref node_id_t for the new node * @param parameters Pointer to @ref node_parameters_t (SNIP, protocol flags, events) *
| void OpenLcb_run | ( | void | ) |
Runs one iteration of all state machines and periodic services.
Runs one iteration of all state machines.
| void OpenLcb_100ms_timer_tick | ( | void | ) |
Increments the global 100ms tick counter. This is the ONLY action performed by the timer interrupt — all real work runs in the main loop.
Increments the global 100ms tick counter.
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License