24 #define UAVCAN_STM32_LOG(fmt, ...) hal.console->printf("CANManager: " fmt "\n", ##__VA_ARGS__) 26 #include <uavcan/uavcan.hpp> 27 #include <uavcan/time.hpp> 29 #include <uavcan_stm32/thread.hpp> 30 #include <uavcan_stm32/clock.hpp> 31 #include <uavcan_stm32/can.hpp> 35 #define MAX_NUMBER_OF_CAN_INTERFACES 2 36 #define MAX_NUMBER_OF_CAN_DRIVERS 2 37 #define CAN_STM32_RX_QUEUE_SIZE 64 44 class CANManager:
public AP_HAL::CANManager {
47 : can_helper(),
AP_HAL::CANManager(&can_helper.driver) { }
55 static CANManager *from(AP_HAL::CANManager *can)
57 return static_cast<CANManager*
>(can);
60 bool begin(uint32_t bitrate, uint8_t can_number)
override;
67 bool is_initialized()
override;
68 void initialized(
bool val)
override;
71 void set_UAVCAN(
AP_UAVCAN *uavcan)
override;
78 uavcan_stm32::CanInitHelper<CAN_STM32_RX_QUEUE_SIZE> can_helper;