OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
can_buffer_fifo.h
Go to the documentation of this file.
1
37#ifndef __DRIVERS_CANBUS_CAN_BUFFER_FIFO__
38#define __DRIVERS_CANBUS_CAN_BUFFER_FIFO__
39
40#include <stdbool.h>
41#include <stdint.h>
42
43#include "can_types.h"
44
45#ifdef __cplusplus
46extern "C"
47{
48#endif /* __cplusplus */
49
58 extern void CanBufferFifo_initialize(void);
59
72 extern bool CanBufferFifo_push(can_msg_t *new_msg);
73
88 extern can_msg_t *CanBufferFifo_pop(void);
89
91 extern uint8_t CanBufferFifo_is_empty(void);
92
94 extern uint16_t CanBufferFifo_get_allocated_count(void);
95
96#ifdef __cplusplus
97}
98#endif /* __cplusplus */
99
100#endif /* __DRIVERS_CANBUS_CAN_BUFFER_FIFO__ */
can_msg_t * CanBufferFifo_pop(void)
Removes and returns the oldest can_msg_t from the FIFO.
Definition can_buffer_fifo.c:125
uint16_t CanBufferFifo_get_allocated_count(void)
Returns the number of can_msg_t pointers currently in the FIFO.
Definition can_buffer_fifo.c:161
bool CanBufferFifo_push(can_msg_t *new_msg)
Pushes a can_msg_t pointer onto the tail of the FIFO.
Definition can_buffer_fifo.c:92
void CanBufferFifo_initialize(void)
Clears all FIFO slots and resets head and tail to zero.
Definition can_buffer_fifo.c:65
uint8_t CanBufferFifo_is_empty(void)
Returns non-zero if the FIFO is empty, zero if messages are present.
Definition can_buffer_fifo.c:148
Type definitions and constants for the CAN transport layer.
Definition can_types.h:118

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