20 #include "platform/platform.h" 22 #if DEVICE_CAN || defined(DOXYGEN_ONLY) 24 #include "hal/can_api.h" 25 #include "platform/Callback.h" 26 #include "platform/PlatformMutex.h" 27 #include "platform/NonCopyable.h" 66 CANMessage(
unsigned int _id,
const unsigned char *_data,
unsigned char _len = 8,
CANType _type = CANData,
CANFormat _format = CANStandard)
72 memcpy(data, _data, _len);
90 memcpy(data, _data, _len);
163 CAN(PinName rd, PinName td);
171 CAN(PinName rd, PinName td,
int hz);
201 int frequency(
int hz);
234 void monitor(
bool silent);
266 int filter(
unsigned int id,
unsigned int mask,
CANFormat format = CANAny,
int handle = 0);
272 unsigned char rderror();
278 unsigned char tderror();
316 "The attach function does not support cv-qualifiers. Replaced by " 317 "attach(callback(obj, method), type).")
318 void attach(T *obj,
void (T::*method)(), IrqType type =
RxIrq)
321 attach(
callback(obj, method), type);
336 "The attach function does not support cv-qualifiers. Replaced by " 337 "attach(callback(obj, method), type).")
338 void attach(T *obj,
void (*method)(T *), IrqType type =
RxIrq)
341 attach(
callback(obj, method), type);
344 static void _irq_handler(uint32_t
id, CanIrqType type);
346 #if !defined(DOXYGEN_ONLY) 349 virtual void unlock();
CANType
Values that represent CAN Type.
CANMessage()
Creates empty CAN message.
Transmit Data Register Empty.
Prevents generation of copy constructor and copy assignment operator in derived classes.
Receive Data Register Full.
CANFormat
Values that represent CAN Format.
CANMessage(unsigned int _id, CANFormat _format=CANStandard)
Creates CAN remote message.
CANMessage(unsigned int _id, const unsigned char *_data, unsigned char _len=8, CANType _type=CANData, CANFormat _format=CANStandard)
Creates CAN message with specific content.
CANMessage(unsigned int _id, const char *_data, unsigned char _len=8, CANType _type=CANData, CANFormat _format=CANStandard)
Creates CAN message with specific content.
Callback class based on template specialization.
A can bus client, used for communicating with can devices.
Holder for single CAN message.