diff --git a/libuavcan_drivers/lpc11c24/driver/include/uavcan_lpc11c24/can.hpp b/libuavcan_drivers/lpc11c24/driver/include/uavcan_lpc11c24/can.hpp index 321726cd9d..4093146cfd 100644 --- a/libuavcan_drivers/lpc11c24/driver/include/uavcan_lpc11c24/can.hpp +++ b/libuavcan_drivers/lpc11c24/driver/include/uavcan_lpc11c24/can.hpp @@ -8,7 +8,11 @@ namespace uavcan_lpc11c24 { - +/** + * This class implements CAN driver interface for libuavcan. + * No configuration needed other than CAN baudrate. + * This class is a singleton. + */ class CanDriver : public uavcan::ICanDriver , public uavcan::ICanIface @@ -19,13 +23,25 @@ class CanDriver CanDriver() { } public: + /** + * Returns the singleton reference. + * No other copies can be created. + */ static CanDriver& instance() { return self; } + /** + * Returns negative value if the requested baudrate can't be used. + * Returns zero if OK. + */ int init(uavcan::uint32_t baudrate); bool hasReadyRx() const; bool hasEmptyTx() const; + /** + * This method will return true only if there was any CAN bus activity since previous call of this method. + * This is intended to be used for LED iface activity indicators. + */ bool hadActivity(); virtual uavcan::int16_t send(const uavcan::CanFrame& frame, uavcan::MonotonicTime tx_deadline, diff --git a/libuavcan_drivers/lpc11c24/driver/include/uavcan_lpc11c24/clock.hpp b/libuavcan_drivers/lpc11c24/driver/include/uavcan_lpc11c24/clock.hpp index 211f53cd86..3ff6b4d127 100644 --- a/libuavcan_drivers/lpc11c24/driver/include/uavcan_lpc11c24/clock.hpp +++ b/libuavcan_drivers/lpc11c24/driver/include/uavcan_lpc11c24/clock.hpp @@ -58,7 +58,6 @@ class SystemClock : public uavcan::ISystemClock, uavcan::Noncopyable public: /** * Calls clock::init() as needed. - * This function is thread safe. */ static SystemClock& instance(); };