20#include "platform/platform.h"
22#if DEVICE_CAN || defined(DOXYGEN_ONLY)
24#include "interfaces/InterfaceCAN.h"
25#include "hal/can_api.h"
26#include "platform/Callback.h"
27#include "rtos/Mutex.h"
40#ifdef FEATURE_EXPERIMENTAL_API
90 CAN(PinName rd, PinName td);
98 CAN(PinName rd, PinName td,
int hz);
181 int filter(
unsigned int id,
unsigned int mask,
CANFormat format = CANAny,
int handle = 0);
205 static void _irq_handler(uintptr_t context, CanIrqType type);
207#if !defined(DOXYGEN_ONLY)
210 virtual void unlock();
213 Callback<void()> _irq[IrqType::IrqCnt];
A can bus client, used for communicating with can devices.
unsigned char rderror()
Detects read errors - Used to detect read overflow errors.
CAN(PinName rd, PinName td, int hz)
Initialize CAN interface and set the frequency.
CAN(PinName rd, PinName td)
Creates a CAN interface connected to specific pins.
CAN(const can_pinmap_t &pinmap, int hz)
Initialize CAN interface and set the frequency.
int write(CANMessage msg)
Write a CANMessage to the bus.
int mode(Mode mode)
Change CAN operation to the specified mode.
void monitor(bool silent)
Puts or removes the CAN interface into silent monitoring mode.
unsigned char tderror()
Detects write errors - Used to detect write overflow errors.
int filter(unsigned int id, unsigned int mask, CANFormat format=CANAny, int handle=0)
Filter out incoming messages.
int frequency(int hz)
Set the frequency of the CAN interface.
void reset()
Reset CAN interface.
void attach(Callback< void()> func, IrqType type=IrqType::RxIrq)
Attach a function to call whenever a CAN frame received interrupt is generated.
int read(CANMessage &msg, int handle=0)
Read a CANMessage from the bus.
CAN(const can_pinmap_t &pinmap)
Initialize CAN interface.
Callback class based on template specialization.
The Mutex class is used to synchronize the execution of threads.
CANFormat
Values that represent CAN Format.