37#ifndef _FREERTOS_DRIVERS_ARDUINO_CAN_HXX_
38#define _FREERTOS_DRIVERS_ARDUINO_CAN_HXX_
50 static unsigned numReceivedPackets_;
51 static unsigned numTransmittedPackets_;
69 int read(
struct can_frame *frame)
79 int write(
const struct can_frame *frame)
97 Can(
const char *ignored)
99 config_can_tx_buffer_size(), config_can_tx_buffer_size() / 2))
101 config_can_rx_buffer_size()))
See OSMutexLock in os/OS.hxx.
Lightweight locking class for protecting small critical sections.
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.
unsigned int busOffCount
bus-off count
virtual void enable()=0
function to enable device
Can(const char *ignored)
Constructor.
virtual void disable()=0
function to disable device
DeviceBuffer< struct can_frame > * rxBuf
receive buffer
virtual void tx_msg()=0
function to try and transmit a message
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.
size_t get(T *buf, size_t items)
remove a number of items from the buffer.
size_t put(const T *buf, size_t items)
Insert a number of items to the buffer.
void destroy()
Destroy an existing DeviceBuffer instance.
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.