27class TerraC6Pins final :
public Pins {
30 const I2cPins& i2c()
const override {
return i2c_; }
32 const SpiPins& spi()
const override {
return spi_; }
34 const DisplayPins& display()
const override {
return display_; }
36 const ButtonPins& buttons()
const override {
return buttons_; }
38 const BatteryPins& battery()
const override {
return battery_; }
41 const I2cPins i2c_{{22, PinFunction::I2c}, {23, PinFunction::I2c}};
42 const SpiPins spi_{{19, PinFunction::Spi}, {18, PinFunction::Spi}, {-1, PinFunction::Spi}};
43 const DisplayPins display_{{21, PinFunction::Gpio, PinPull::None, PinActiveLevel::Low, PinDirection::Output},
44 {17, PinFunction::Gpio, PinPull::None, PinActiveLevel::High, PinDirection::Output},
45 {16, PinFunction::Gpio, PinPull::None, PinActiveLevel::Low, PinDirection::Output},
46 {20, PinFunction::Gpio, PinPull::None, PinActiveLevel::High, PinDirection::Input}};
47 const ButtonPins buttons_{{2, PinFunction::Gpio, PinPull::Up, PinActiveLevel::Low, PinDirection::Input},
48 {1, PinFunction::Gpio, PinPull::Up, PinActiveLevel::Low, PinDirection::Input}};
49 const BatteryPins battery_{{0, PinFunction::Adc, PinPull::None, PinActiveLevel::High, PinDirection::Input}, 2, 1};
60class BoardTerraC6 :
public Board {
65 ~BoardTerraC6()
override =
default;
68 Result<void> init()
override;
70 const char* getName()
const override {
return getDeviceInfo().name; }
72 const DeviceInfo& getDeviceInfo()
const override;
74 const BoardConfig& getConfig()
const override {
return config_; }
76 const Pins& getPins()
const override {
return pins_; }
79 hal::IDisplay& getDisplay()
override {
return display_; }
81 hal::IRtc& getRtc()
override {
return rtc_; }
83 hal::IBattery& getBattery()
override {
return battery_; }
85 hal::IInput& getInput()
override {
return input_; }
87 hal::IBluetooth& getBluetooth()
override {
return bluetooth_; }
89 hal::ICompanionSource& getCompanionSource()
override {
return bluetooth_; }
91 hal::IWifiRadio& getWifi()
override {
return wifi_; }
93 hal::IPowerManagement& getPowerManagement()
override {
return powerManagement_; }
95 hal::IConsole& getConsole()
override {
return console_; }
96 hal::IHttpServer& getHttpServer()
override {
return web_; }
97 hal::IDnsServer& getDnsServer()
override {
return web_; }
98 hal::IHttpClient& getHttpClient()
override {
return httpClient_; }
99 hal::INtpTimeSource& getNtpTimeSource()
override {
return ntpTimeSource_; }
100 hal::IPlatformDiagnostics& getDiagnostics()
override {
return diagnostics_; }
103 uint32_t getUptimeMs()
const override;
105 void delayMs(uint32_t ms)
override;
107 void restart()
override;
110 static BoardTerraC6& instance();
115 drivers::display::Ssd1681Display display_;
117 hal::Esp32Battery battery_;
118 hal::Esp32Input input_;
119 hal::Esp32Bluetooth bluetooth_;
120 hal::Esp32Wifi wifi_;
121 hal::Esp32PowerManagement powerManagement_;
122 hal::Esp32UsbConsole console_;
123 hal::Esp32WebServer web_;
124 hal::Esp32HttpClient httpClient_;
125 hal::Esp32NtpTimeSource ntpTimeSource_;
126 hal::Esp32PlatformDiagnostics diagnostics_;
Definition application.h:10