1#ifndef VITROIO_SDK_CANBUS_H
2#define VITROIO_SDK_CANBUS_H
27#define VITROIO_CANBUS_DEFAULT_FREQUENCY 500000
35#define VITROIO_CANBUS_DEFAULT_EVENT_QUEUE_SIZE 32
49class Canbus :
private NonCopyable<Canbus>
84 PinName rd, PinName td,
85 EventQueue* targetQueue,
106 PinName rd, PinName td,
107 osPriority priority = osPriorityNormal,
156 static const uint32_t onFramesReceivedCallbacksCnt_ = 4;
162 Thread* evQueueThread_;
Class is a wrapper for mbed::CANMessage. It provides interface allowing creation of frames complied w...
Definition: canbus_frame.h:24
Class is a wrapper for mbed::CAN class and provides interface for CanbusFrame type.
Definition: canbus.h:50
bool isValid() const
Function allows to check whether the bus is in valid state.
int setOnFrameReceivedCallback(OnFrameReceivedCallback callback, int handle=-1)
Function allows to set callbacks which are to be called any time the frame received.
Callback< void(const CanbusFrame &)> OnFrameReceivedCallback
Type defines signature of callback function which is to be called when a new frame will be received.
Definition: canbus.h:56
Canbus(PinName rd, PinName td, EventQueue *targetQueue, uint32_t eventQueueSize=VITROIO_CANBUS_DEFAULT_EVENT_QUEUE_SIZE, int hz=VITROIO_CANBUS_DEFAULT_FREQUENCY)
Constructor initializes CAN bus and chains an internal event queue to the targetQueue.
int sendFrame(const CanbusFrame &frame)
Functions sends frame over the bus.
Canbus(PinName rd, PinName td, osPriority priority=osPriorityNormal, uint32_t eventQueueSize=VITROIO_CANBUS_DEFAULT_EVENT_QUEUE_SIZE, int hz=VITROIO_CANBUS_DEFAULT_FREQUENCY)
Constructor initializes CAN bus and creates internal event loop using thread with priority priority.
The _CAN class is a simple extension of mbed::CAN class.
Definition: _CAN.h:37
#define VITROIO_CANBUS_DEFAULT_FREQUENCY
Defines default communication frequency for Canbus .
Definition: canbus.h:27
#define VITROIO_CANBUS_DEFAULT_EVENT_QUEUE_SIZE
Defines default size of internal event queue for Canbus .
Definition: canbus.h:35
The namespace contains all of components of vitro-shard-sdk and components based on the sdk....
Definition: can_layer.h:9