tutrc_harurobo_lib
読み取り中…
検索中…
一致する文字列を見つけられません
can.hpp
[詳解]
1#pragma once
2
3#include "main.h"
4
5#include <cstddef>
6#include <cstdint>
7#include <unordered_map>
8
9#include "cmsis_os2.h"
10
11#include "can_base.hpp"
12
13namespace tutrc_harurobo_lib {
14
15class CAN : public CANBase {
16public:
17 bool init(CAN_HandleTypeDef *hcan, size_t rx_queue_size = 64);
18 bool transmit(const CANMessage *msg) override;
19 bool receive(CANMessage *msg, uint32_t timeout) override;
20 size_t available() override;
21
22private:
23 CAN_HandleTypeDef *hcan_;
24 osMessageQueueId_t rx_queue_;
25
26 static std::unordered_map<CAN_HandleTypeDef *, CAN *> instances_;
27 friend void ::HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
28};
29
30} // namespace tutrc_harurobo_lib
Definition can_base.hpp:20
Definition can.hpp:15
bool init(CAN_HandleTypeDef *hcan, size_t rx_queue_size=64)
bool receive(CANMessage *msg, uint32_t timeout) override
bool transmit(const CANMessage *msg) override
size_t available() override
Definition bno055.hpp:10
Definition can_base.hpp:13