43#ifndef __OPENLCB_APPLICATION_BROADCAST_TIME__
44#define __OPENLCB_APPLICATION_BROADCAST_TIME__
51#ifndef BROADCAST_TIME_MAX_CUSTOM_CLOCKS
52#define BROADCAST_TIME_MAX_CUSTOM_CLOCKS 4
55#define BROADCAST_TIME_WELLKNOWN_CLOCK_COUNT 4
56#define BROADCAST_TIME_TOTAL_CLOCK_COUNT (BROADCAST_TIME_WELLKNOWN_CLOCK_COUNT + BROADCAST_TIME_MAX_CUSTOM_CLOCKS)
bool OpenLcbApplicationBroadcastTime_send_command_stop(openlcb_node_t *openlcb_node, event_id_t clock_id)
Sends a Stop command to a clock generator.
Definition openlcb_application_broadcast_time.c:1391
void OpenLcbApplicationBroadcastTime_start(event_id_t clock_id)
Marks the given clock as running so the 100 ms tick will advance it.
Definition openlcb_application_broadcast_time.c:276
bool OpenLcbApplicationBroadcastTime_send_date_rollover(openlcb_node_t *openlcb_node, event_id_t clock_id)
Sends a Date Rollover event for a producer clock.
Definition openlcb_application_broadcast_time.c:1055
void OpenLcbApplicationBroadcastTime_trigger_sync_delay(event_id_t clock_id)
Starts or resets the 3-second sync delay timer for a producer clock.
Definition openlcb_application_broadcast_time.c:1439
bool OpenLcbApplicationBroadcastTime_send_report_year(openlcb_node_t *openlcb_node, event_id_t clock_id, uint16_t year)
Sends a Report Year event (Producer Identified Set) for a producer clock.
Definition openlcb_application_broadcast_time.c:918
bool OpenLcbApplicationBroadcastTime_send_set_date(openlcb_node_t *openlcb_node, event_id_t clock_id, uint8_t month, uint8_t day)
Sends a Set Date command to a clock generator.
Definition openlcb_application_broadcast_time.c:1301
bool OpenLcbApplicationBroadcastTime_is_consumer(event_id_t clock_id)
Returns whether the given clock is registered as a consumer.
Definition openlcb_application_broadcast_time.c:356
void OpenLcbApplicationBroadcastTime_initialize(const interface_openlcb_application_broadcast_time_t *interface)
Initialises the broadcast time module and stores the callback interface.
Definition openlcb_application_broadcast_time.c:161
broadcast_clock_state_t * OpenLcbApplicationBroadcastTime_setup_consumer(openlcb_node_t *openlcb_node, event_id_t clock_id)
Allocates a clock slot as a consumer and registers event ranges on the node.
Definition openlcb_application_broadcast_time.c:188
bool OpenLcbApplicationBroadcastTime_is_producer(event_id_t clock_id)
Returns whether the given clock is registered as a producer.
Definition openlcb_application_broadcast_time.c:383
bool OpenLcbApplicationBroadcastTime_send_report_rate(openlcb_node_t *openlcb_node, event_id_t clock_id, int16_t rate)
Sends a Report Rate event (Producer Identified Set) for a producer clock.
Definition openlcb_application_broadcast_time.c:953
bool OpenLcbApplicationBroadcastTime_send_set_year(openlcb_node_t *openlcb_node, event_id_t clock_id, uint16_t year)
Sends a Set Year command to a clock generator.
Definition openlcb_application_broadcast_time.c:1324
broadcast_clock_state_t * OpenLcbApplicationBroadcastTime_setup_producer(openlcb_node_t *openlcb_node, event_id_t clock_id)
Allocates a clock slot as a producer and registers event ranges on the node.
Definition openlcb_application_broadcast_time.c:235
bool OpenLcbApplicationBroadcastTime_send_command_start(openlcb_node_t *openlcb_node, event_id_t clock_id)
Sends a Start command to a clock generator.
Definition openlcb_application_broadcast_time.c:1369
bool OpenLcbApplicationBroadcastTime_send_query(openlcb_node_t *openlcb_node, event_id_t clock_id)
Sends a Query event for a consumer clock.
Definition openlcb_application_broadcast_time.c:1240
bool OpenLcbApplicationBroadcastTime_send_start(openlcb_node_t *openlcb_node, event_id_t clock_id)
Sends a Start event for a producer clock.
Definition openlcb_application_broadcast_time.c:987
void OpenLcbApplicationBroadcastTime_trigger_query_reply(event_id_t clock_id)
Triggers an immediate query reply (6-message sync sequence) for a producer clock.
Definition openlcb_application_broadcast_time.c:1410
bool OpenLcbApplicationBroadcastTime_send_set_rate(openlcb_node_t *openlcb_node, event_id_t clock_id, int16_t rate)
Sends a Set Rate command to a clock generator.
Definition openlcb_application_broadcast_time.c:1347
bool OpenLcbApplicationBroadcastTime_send_stop(openlcb_node_t *openlcb_node, event_id_t clock_id)
Sends a Stop event for a producer clock.
Definition openlcb_application_broadcast_time.c:1021
bool OpenLcbApplicationBroadcastTime_send_report_time(openlcb_node_t *openlcb_node, event_id_t clock_id, uint8_t hour, uint8_t minute)
Sends a Report Time event (Producer Identified Set) for a producer clock.
Definition openlcb_application_broadcast_time.c:847
void OpenLcbApplicationBroadcastTime_stop(event_id_t clock_id)
Marks the given clock as stopped so the 100 ms tick will not advance it.
Definition openlcb_application_broadcast_time.c:301
void OpenLcbApplicationBroadcastTime_100ms_time_tick(uint8_t current_tick)
Advances all running consumer clocks based on elapsed ticks.
Definition openlcb_application_broadcast_time.c:653
bool OpenLcbApplicationBroadcastTime_send_set_time(openlcb_node_t *openlcb_node, event_id_t clock_id, uint8_t hour, uint8_t minute)
Sends a Set Time command to a clock generator.
Definition openlcb_application_broadcast_time.c:1277
broadcast_clock_state_t * OpenLcbApplicationBroadcastTime_get_clock(event_id_t clock_id)
Returns the state for a registered clock.
Definition openlcb_application_broadcast_time.c:329
bool OpenLcbApplicationBroadcastTime_send_report_date(openlcb_node_t *openlcb_node, event_id_t clock_id, uint8_t month, uint8_t day)
Sends a Report Date event (Producer Identified Set) for a producer clock.
Definition openlcb_application_broadcast_time.c:883
bool OpenLcbApplicationBroadcastTime_send_query_reply(openlcb_node_t *openlcb_node, event_id_t clock_id, uint8_t next_hour, uint8_t next_minute)
Sends the full query reply sequence for a producer clock.
Definition openlcb_application_broadcast_time.c:1207
Core type definitions, structures, and configuration constants for the OpenLCB library.
uint64_t event_id_t
64-bit Event ID.
Definition openlcb_types.h:340
Complete state for one Broadcast Time clock.
Definition openlcb_types.h:407
A clock slot with state and subscription flags.
Definition openlcb_types.h:420
Application-provided callbacks for broadcast time events.
Definition openlcb_application_broadcast_time.h:67
OpenLCB virtual node.
Definition openlcb_types.h:679