10 # include <nuttx/config.h> 11 # include <nuttx/fs/fs.h> 21 #include <uavcan/uavcan.hpp> 28 #if UAVCAN_STM32_NUTTX 33 class BusEvent : uavcan::Noncopyable
35 using SignalCallbackHandler = void(*)();
37 SignalCallbackHandler signal_cb_{
nullptr};
41 BusEvent(CanDriver &can_driver);
44 void registerSignalCallback(SignalCallbackHandler handler) { signal_cb_ = handler; }
46 bool wait(uavcan::MonotonicDuration duration);
48 void signalFromInterrupt();
53 pthread_mutex_t mutex_;
63 return pthread_mutex_init(&mutex_, UAVCAN_NULLPTR);
68 return pthread_mutex_destroy(&mutex_);
73 (void)pthread_mutex_lock(&mutex_);
78 (void)pthread_mutex_unlock(&mutex_);
void init()
Activates/configures the hardware registers.
MutexLocker(Mutex &mutex)