mirror of
https://github.com/esphome/esphome.git
synced 2024-12-02 11:44:13 +01:00
30 lines
578 B
C
30 lines
578 B
C
|
#pragma once
|
||
|
|
||
|
#ifdef USE_ESP32
|
||
|
|
||
|
#include "esphome/components/canbus/canbus.h"
|
||
|
#include "esphome/core/component.h"
|
||
|
|
||
|
namespace esphome {
|
||
|
namespace esp32_can {
|
||
|
|
||
|
class ESP32Can : public canbus::Canbus {
|
||
|
public:
|
||
|
void set_rx(int rx) { rx_ = rx; }
|
||
|
void set_tx(int tx) { tx_ = tx; }
|
||
|
ESP32Can(){};
|
||
|
|
||
|
protected:
|
||
|
bool setup_internal() override;
|
||
|
canbus::Error send_message(struct canbus::CanFrame *frame) override;
|
||
|
canbus::Error read_message(struct canbus::CanFrame *frame) override;
|
||
|
|
||
|
int rx_{-1};
|
||
|
int tx_{-1};
|
||
|
};
|
||
|
|
||
|
} // namespace esp32_can
|
||
|
} // namespace esphome
|
||
|
|
||
|
#endif
|