ESPHome  2023.3.2
esp32_can.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef USE_ESP32
4 
7 
8 namespace esphome {
9 namespace esp32_can {
10 
11 class ESP32Can : public canbus::Canbus {
12  public:
13  void set_rx(int rx) { rx_ = rx; }
14  void set_tx(int tx) { tx_ = tx; }
15  ESP32Can(){};
16 
17  protected:
18  bool setup_internal() override;
19  canbus::Error send_message(struct canbus::CanFrame *frame) override;
20  canbus::Error read_message(struct canbus::CanFrame *frame) override;
21 
22  int rx_{-1};
23  int tx_{-1};
24 };
25 
26 } // namespace esp32_can
27 } // namespace esphome
28 
29 #endif
bool setup_internal() override
Definition: esp32_can.cpp:42
canbus::Error read_message(struct canbus::CanFrame *frame) override
Definition: esp32_can.cpp:99
Definition: a4988.cpp:4
canbus::Error send_message(struct canbus::CanFrame *frame) override
Definition: esp32_can.cpp:70