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);
183 int frequency(
int hz);
216 void monitor(
bool silent);
248 int filter(
unsigned int id,
unsigned int mask,
CANFormat format = CANAny,
int handle = 0);
254 unsigned char rderror();
260 unsigned char tderror();
298 "The attach function does not support cv-qualifiers. Replaced by " 299 "attach(callback(obj, method), type).")
300 void attach(T *obj,
void (T::*method)(), IrqType type =
RxIrq)
303 attach(
callback(obj, method), type);
318 "The attach function does not support cv-qualifiers. Replaced by " 319 "attach(callback(obj, method), type).")
320 void attach(T *obj,
void (*method)(T *), IrqType type =
RxIrq)
323 attach(
callback(obj, method), type);
326 static void _irq_handler(uint32_t
id, CanIrqType type);
328 #if !defined(DOXYGEN_ONLY) 331 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.