#include <can.hpp>
Public Member Functions | |
virtual const ICanIface * | getIface (uint8_t iface_index) const |
virtual ICanIface * | getIface (uint8_t iface_index)=0 |
virtual uint8_t | getNumIfaces () const =0 |
virtual int16_t | select (CanSelectMasks &inout_masks, const CanFrame *(&pending_tx)[MaxCanIfaces], MonotonicTime blocking_deadline)=0 |
virtual | ~ICanDriver () |
Generic CAN driver.
Definition at line 207 of file libuavcan/libuavcan/include/uavcan/driver/can.hpp.
|
inlinevirtual |
Definition at line 210 of file libuavcan/libuavcan/include/uavcan/driver/can.hpp.
Default implementation of this method calls the non-const overload of getIface(). Can be overriden by the application if necessary.
Reimplemented in CanDriverMock, and PairableCanDriver.
Definition at line 221 of file libuavcan/libuavcan/include/uavcan/driver/can.hpp.
Returns an interface by index, or null pointer if the index is out of range.
Implemented in uavcan_lpc11c24::CanDriver, uavcan_kinetis::CanDriver, uavcan_stm32::CanDriver, CanDriverMock, PairableCanDriver, and uavcan_linux::SocketCanDriver.
|
pure virtual |
Total number of available CAN interfaces. This value shall not change after initialization.
Implemented in uavcan_linux::SocketCanDriver, VirtualCanDriver< SharedMemoryPoolSize >, uavcan_lpc11c24::CanDriver, uavcan_kinetis::CanDriver, uavcan_stm32::CanDriver, CanDriverMock, and PairableCanDriver.
|
pure virtual |
Block until the deadline, or one of the specified interfaces becomes available for read or write.
Iface masks will be modified by the driver to indicate which exactly interfaces are available for IO.
Bit position in the masks defines interface index.
Note that it is allowed to return from this method even if no requested events actually happened, or if there are events that were not requested by the library.
The pending TX argument contains an array of pointers to CAN frames that the library wants to transmit next, per interface. This is intended to allow the driver to properly prioritize transmissions; many drivers will not need to use it. If a write flag for the given interface is set to one in the select mask structure, then the corresponding pointer is guaranteed to be valid (not UAVCAN_NULLPTR).
[in,out] | inout_masks | Masks indicating which interfaces are needed/available for IO. |
[in] | pending_tx | Array of frames, per interface, that are likely to be transmitted next. |
[in] | blocking_deadline | Zero means non-blocking operation. |