21#ifndef M5_UNIT_RS485_UNIT_SIT3088_HPP
22#define M5_UNIT_RS485_UNIT_SIT3088_HPP
59 virtual bool begin()
override;
105 virtual std::unique_ptr<ISerial>
make_serial(AdapterUART *ad)
override;
107 inline int8_t configured_dir_pin()
const
109 return _configured_dir_pin;
117 struct DirControlledSerial;
118 struct DirControlledIDFSerial;
121 int8_t _configured_dir_pin{-1};
Non-instantiable base class for RS-485 transceiver units.
Definition rs485_component.hpp:37
config_t config() const
Gets the configuration.
Definition rs485_component.hpp:108
RS-485 unit using the SIT3088 transceiver (manual direction control via a DIR pin)
Definition unit_SIT3088.hpp:33
virtual bool begin() override
Configure the DIR pin, then begin using the registered UART adapter.
Definition unit_SIT3088.cpp:118
virtual std::unique_ptr< ISerial > make_serial(AdapterUART *ad) override
Factory hook: build the concrete ISerial to be used by begin().
Definition unit_SIT3088.cpp:172
void config(const config_t &cfg)
Sets the configuration.
Definition unit_SIT3088.hpp:82
config_t config() const
Gets the configuration.
Definition unit_SIT3088.hpp:67
virtual void configure_dir_pin(const int8_t pin)
One-time setup of the DIR pin as an output (called by begin()).
Definition unit_SIT3088.cpp:145
UnitSIT3088()
Constructor. dir_pin remains unset; set via config() before begin().
Definition unit_SIT3088.cpp:114
virtual void set_transmit(const bool tx_enable)
Switch the transceiver into transmit (true) or receive (false) mode.
Definition unit_SIT3088.cpp:160
virtual ~UnitSIT3088()=default
Destructor.
Top level namespace of M5Stack.
Common base for RS-485 transceiver units in M5UnitUnified.
Settings for begin.
Definition rs485_component.hpp:98
Settings for begin (extends RS485Component::config_t with the SIT3088 DIR pin)
Definition unit_SIT3088.hpp:44
int8_t dir_pin
DIR (DE/RE tied) GPIO number; -1 = unset (begin() fails)
Definition unit_SIT3088.hpp:45