34#ifndef _FREERTOS_DRIVERS_COMMON_CAN_HXX_
35#define _FREERTOS_DRIVERS_COMMON_CAN_HXX_
48 static unsigned numReceivedPackets_;
49 static unsigned numTransmittedPackets_;
57 Can(
const char *
name,
size_t tx_buffer_size = config_can_tx_buffer_size(),
58 size_t rx_buffer_size = config_can_rx_buffer_size())
Base class for a CAN device for the Arduino environment.
unsigned int overrunCount
overrun count
unsigned int softErrorCount
soft error count
DeviceBuffer< struct can_frame > * txBuf
transmit buffer
int read(struct can_frame *frame)
Read a frame if there is one available.
void flush_buffers() OVERRIDE
called after disable
unsigned int busOffCount
bus-off count
Can(const char *name, size_t tx_buffer_size=config_can_tx_buffer_size(), size_t rx_buffer_size=config_can_rx_buffer_size())
Constructor.
bool has_rx_buffer_data() OVERRIDE
void disable() override=0
function to disable device
DeviceBuffer< struct can_frame > * rxBuf
receive buffer
bool has_tx_buffer_space() OVERRIDE
virtual void tx_msg()=0
function to try and transmit a message
bool select(File *file, int mode) OVERRIDE
Device select method.
void enable() override=0
function to enable device
int write(const struct can_frame *frame)
Send a frame if there is space available.
size_t space()
Return the number of items for which space is available.
size_t pending()
Return the number of items in the queue.
Implements a smart buffer specifically designed for character device drivers.
void destroy()
Destroy an existing DeviceBuffer instance.
const char * name
device name
Node information for a device node in the filesystem that has support for nonblocking mode via Notifi...
#define OVERRIDE
Function attribute for virtual functions declaring that this funciton is overriding a funciton that s...
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.