PX4 Firmware
PX4 Autopilot Software http://px4.io
|
CAN driver, incorporates all available CAN ifaces. More...
#include <can.hpp>
Public Member Functions | |
template<unsigned RxQueueCapacity> | |
CanDriver (CanRxItem(&rx_queue_storage)[UAVCAN_KINETIS_NUM_IFACES][RxQueueCapacity]) | |
uavcan::CanSelectMasks | makeSelectMasks (const uavcan::CanFrame *(&pending_tx)[uavcan::MaxCanIfaces]) const |
This function returns select masks indicating which interfaces are available for read/write. More... | |
bool | hasReadableInterfaces () const |
Whether there's at least one interface where receive() would return a frame. More... | |
int | init (const uavcan::uint32_t bitrate, const CanIface::OperatingMode mode) |
Returns zero if OK. More... | |
virtual CanIface * | getIface (uavcan::uint8_t iface_index) |
virtual uavcan::uint8_t | getNumIfaces () const |
bool | hadActivity () |
Whether at least one iface had at least one successful IO since previous call of this method. More... | |
BusEvent & | updateEvent () |
Private Member Functions | |
virtual uavcan::int16_t | select (uavcan::CanSelectMasks &inout_masks, const uavcan::CanFrame *(&pending_tx)[uavcan::MaxCanIfaces], uavcan::MonotonicTime blocking_deadline) |
Static Private Member Functions | |
static void | initOnce () |
Private Attributes | |
BusEvent | update_event_ |
CanIface | if0_ |
CAN driver, incorporates all available CAN ifaces.
Please avoid direct use, prefer CanInitHelper instead.
|
inline |
Definition at line 286 of file can.hpp.
References ToneAlarmInterface::init().
|
virtual |
Definition at line 972 of file uc_kinetis_flexcan.cpp.
Referenced by uavcan_kinetis::CanInitHelper< RxQueueCapacity >::init().
|
inlinevirtual |
Definition at line 314 of file can.hpp.
Referenced by uavcan_kinetis::CanInitHelper< RxQueueCapacity >::init().
bool uavcan_kinetis::CanDriver::hadActivity | ( | ) |
Whether at least one iface had at least one successful IO since previous call of this method.
This is designed for use with iface activity LEDs.
Definition at line 981 of file uc_kinetis_flexcan.cpp.
bool uavcan_kinetis::CanDriver::hasReadableInterfaces | ( | ) | const |
Whether there's at least one interface where receive() would return a frame.
Definition at line 844 of file uc_kinetis_flexcan.cpp.
int uavcan_kinetis::CanDriver::init | ( | const uavcan::uint32_t | bitrate, |
const CanIface::OperatingMode | mode | ||
) |
Returns zero if OK.
Returns negative value if failed (e.g. invalid bitrate).
Definition at line 919 of file uc_kinetis_flexcan.cpp.
References UAVCAN_KINETIS_LOG.
Referenced by uavcan_kinetis::CanInitHelper< RxQueueCapacity >::init().
|
staticprivate |
Definition at line 889 of file uc_kinetis_flexcan.cpp.
References uavcan_kinetis::can0_irq(), IRQ_ATTACH, and MicroBenchHRT::lock().
uavcan::CanSelectMasks uavcan_kinetis::CanDriver::makeSelectMasks | ( | const uavcan::CanFrame *(&) | pending_tx[uavcan::MaxCanIfaces] | ) | const |
This function returns select masks indicating which interfaces are available for read/write.
Definition at line 816 of file uc_kinetis_flexcan.cpp.
|
privatevirtual |
Definition at line 855 of file uc_kinetis_flexcan.cpp.
References uavcan_kinetis::clock::getMonotonic().