OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
can_tx_statemachine.h
Go to the documentation of this file.
1
33#ifndef __DRIVERS_CANBUS_CAN_TX_STATEMACHINE__
34#define __DRIVERS_CANBUS_CAN_TX_STATEMACHINE__
35
36#include <stdbool.h>
37#include <stdint.h>
38
39#include "can_types.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif /* __cplusplus */
45
54 typedef struct {
55
57 bool (*is_tx_buffer_empty)(void);
58
60 bool (*handle_addressed_msg_frame)(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index);
61
63 bool (*handle_unaddressed_msg_frame)(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index);
64
66 bool (*handle_datagram_frame)(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index);
67
69 bool (*handle_stream_frame)(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index);
70
72 bool (*handle_can_frame)(can_msg_t *can_msg);
73
84 listener_alias_entry_t *(*listener_find_by_node_id)(node_id_t node_id);
85
87
88
100 extern void CanTxStatemachine_initialize(const interface_can_tx_statemachine_t *interface_can_tx_statemachine);
101
120
134 extern bool CanTxStatemachine_send_can_message(can_msg_t *can_msg);
135
136#ifdef __cplusplus
137}
138#endif /* __cplusplus */
139
140#endif /* __DRIVERS_CANBUS_CAN_TX_STATEMACHINE__ */
bool CanTxStatemachine_send_openlcb_message(openlcb_msg_t *openlcb_msg)
Converts and transmits an openlcb_msg_t as one or more CAN frames.
Definition can_tx_statemachine.c:139
void CanTxStatemachine_initialize(const interface_can_tx_statemachine_t *interface_can_tx_statemachine)
Registers the dependency-injection interface for this module.
Definition can_tx_statemachine.c:56
bool CanTxStatemachine_send_can_message(can_msg_t *can_msg)
Transmits a pre-built raw can_msg_t directly to the hardware.
Definition can_tx_statemachine.c:198
Type definitions and constants for the CAN transport layer.
Core type definitions, structures, and configuration constants for the OpenLCB library.
uint64_t node_id_t
48-bit Node ID stored in a 64-bit type (upper 16 bits unused).
Definition openlcb_types.h:359
Definition can_types.h:118
Dependency-injection interface for the CAN transmit state machine.
Definition can_tx_statemachine.h:54
Definition can_types.h:209
Core OpenLCB message structure.
Definition openlcb_types.h:480

Copyright (c) 2026 Jim Kueneman all rights reserved. See the License