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" 59 CANMessage(
unsigned int _id,
const unsigned char *_data,
unsigned char _len = 8,
CANType _type = CANData,
CANFormat _format = CANStandard)
65 memcpy(data, _data, _len);
83 memcpy(data, _data, _len);
149 CAN(PinName rd, PinName td);
157 CAN(PinName rd, PinName td,
int hz);
169 int frequency(
int hz);
202 void monitor(
bool silent);
234 int filter(
unsigned int id,
unsigned int mask,
CANFormat format = CANAny,
int handle = 0);
240 unsigned char rderror();
246 unsigned char tderror();
270 void attach(
Callback<
void()> func, IrqType type = RxIrq);
284 "The attach function does not support cv-qualifiers. Replaced by " 285 "attach(callback(obj, method), type).")
286 void attach(T *obj,
void (T::*method)(), IrqType type = RxIrq)
289 attach(
callback(obj, method), type);
304 "The attach function does not support cv-qualifiers. Replaced by " 305 "attach(callback(obj, method), type).")
306 void attach(T *obj,
void (*method)(T *), IrqType type = RxIrq)
309 attach(
callback(obj, method), type);
312 static void _irq_handler(uint32_t
id, CanIrqType type);
314 #if !defined(DOXYGEN_ONLY) 317 virtual void unlock();
CANType
Values that represent CAN Type.
CANMessage()
Creates empty CAN message.
Prevents generation of copy constructor and copy assignment operator in derived classes.
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.