Firmware  0.6.0
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1// Copyright (C) 2025 Vincent Hamp
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
21
22#pragma once
23
24#include <driver/rmt_tx.h>
25#include <driver/spi_master.h>
26#include <esp_http_server.h>
27#include <freertos/message_buffer.h>
28#include <freertos/queue.h>
29#include <freertos/stream_buffer.h>
30#include <hal/gpio_types.h>
31#include <static_math/static_math.h>
32#include <atomic>
33#include <climits>
34#include <dcc/dcc.hpp>
35#include <magic_enum/magic_enum.hpp>
36#include <memory>
37#include <string>
38#include <vector>
39#include <ztl/enum.hpp>
40#include <ztl/implicit_wrapper.hpp>
41#include <ztl/limits.hpp>
42#include <ztl/string.hpp>
43#include "task.hpp"
44
45#if CONFIG_IDF_TARGET_ESP32S3
46# include <driver/gptimer.h>
47# include <driver/ledc.h>
48# include <esp_wifi.h>
49# include <hal/adc_types.h>
50#elif CONFIG_IDF_TARGET_LINUX
51# define APP_CPU_NUM 0
52# define PRO_CPU_NUM APP_CPU_NUM
53# define WIFI_TASK_CORE_ID APP_CPU_NUM
54# define ADC_CHANNEL_1 1
55# define ADC_CHANNEL_2 2
56# define ADC_CHANNEL_3 3
57# define ADC_CHANNEL_4 4
58# define ADC_CHANNEL_5 5
59# define ADC_CHANNEL_6 6
60# define ADC_CHANNEL_7 7
61# define ADC_CHANNEL_8 8
62# define ADC_CHANNEL_9 9
63# define ADC_ATTEN_DB_0 0
64# define ADC_ATTEN_DB_2_5 1
65# define ADC_ATTEN_DB_6 2
66# define ADC_ATTEN_DB_11 3
67# define LEDC_CHANNEL_0 0
68# define LEDC_CHANNEL_1 1
69# define LEDC_CHANNEL_2 2
70# define LEDC_CHANNEL_3 3
71# define LEDC_CHANNEL_4 4
72# define LEDC_CHANNEL_5 5
73# define LEDC_CHANNEL_6 6
74# define LEDC_CHANNEL_7 7
75# define SOC_ADC_PATT_LEN_MAX 24
76# define SOC_ADC_DIGI_MAX_BITWIDTH 12
77# define SOC_ADC_DIGI_DATA_BYTES_PER_CONV 4
78# define SOC_ADC_SAMPLE_FREQ_THRES_HIGH 83333
79# define GPIO_NUM_1 static_cast<gpio_num_t>(1)
80# define GPIO_NUM_2 static_cast<gpio_num_t>(2)
81# define GPIO_NUM_3 static_cast<gpio_num_t>(3)
82# define GPIO_NUM_4 static_cast<gpio_num_t>(4)
83# define GPIO_NUM_5 static_cast<gpio_num_t>(5)
84# define GPIO_NUM_6 static_cast<gpio_num_t>(6)
85# define GPIO_NUM_7 static_cast<gpio_num_t>(7)
86# define GPIO_NUM_8 static_cast<gpio_num_t>(8)
87# define GPIO_NUM_9 static_cast<gpio_num_t>(9)
88# define GPIO_NUM_10 static_cast<gpio_num_t>(10)
89# define GPIO_NUM_11 static_cast<gpio_num_t>(11)
90# define GPIO_NUM_12 static_cast<gpio_num_t>(12)
91# define GPIO_NUM_13 static_cast<gpio_num_t>(13)
92# define GPIO_NUM_14 static_cast<gpio_num_t>(14)
93# define GPIO_NUM_15 static_cast<gpio_num_t>(15)
94# define GPIO_NUM_16 static_cast<gpio_num_t>(16)
95# define GPIO_NUM_17 static_cast<gpio_num_t>(17)
96# define GPIO_NUM_18 static_cast<gpio_num_t>(18)
97# define GPIO_NUM_19 static_cast<gpio_num_t>(19)
98# define GPIO_NUM_20 static_cast<gpio_num_t>(20)
99# define GPIO_NUM_21 static_cast<gpio_num_t>(21)
100# define GPIO_NUM_22 static_cast<gpio_num_t>(22)
101# define GPIO_NUM_23 static_cast<gpio_num_t>(23)
102# define GPIO_NUM_24 static_cast<gpio_num_t>(24)
103# define GPIO_NUM_25 static_cast<gpio_num_t>(25)
104# define GPIO_NUM_26 static_cast<gpio_num_t>(26)
105# define GPIO_NUM_27 static_cast<gpio_num_t>(27)
106# define GPIO_NUM_28 static_cast<gpio_num_t>(28)
107# define GPIO_NUM_29 static_cast<gpio_num_t>(29)
108# define GPIO_NUM_30 static_cast<gpio_num_t>(30)
109# define GPIO_NUM_31 static_cast<gpio_num_t>(31)
110# define GPIO_NUM_32 static_cast<gpio_num_t>(32)
111# define GPIO_NUM_33 static_cast<gpio_num_t>(33)
112# define GPIO_NUM_34 static_cast<gpio_num_t>(34)
113# define GPIO_NUM_35 static_cast<gpio_num_t>(35)
114# define GPIO_NUM_36 static_cast<gpio_num_t>(36)
115# define GPIO_NUM_37 static_cast<gpio_num_t>(37)
116# define GPIO_NUM_38 static_cast<gpio_num_t>(38)
117# define GPIO_NUM_39 static_cast<gpio_num_t>(39)
118# define GPIO_NUM_40 static_cast<gpio_num_t>(40)
119# define GPIO_NUM_41 static_cast<gpio_num_t>(41)
120# define GPIO_NUM_42 static_cast<gpio_num_t>(42)
121# define GPIO_NUM_43 static_cast<gpio_num_t>(43)
122# define GPIO_NUM_44 static_cast<gpio_num_t>(44)
123# define GPIO_NUM_45 static_cast<gpio_num_t>(45)
124# define GPIO_NUM_46 static_cast<gpio_num_t>(46)
125# define GPIO_NUM_47 static_cast<gpio_num_t>(47)
126# define GPIO_NUM_48 static_cast<gpio_num_t>(48)
127#else
128# error "Unsupported SOC"
129#endif
130
142inline constexpr auto default_notify_index{tskDEFAULT_INDEX_TO_NOTIFY + 1u};
143static_assert(configTASK_NOTIFICATION_ARRAY_ENTRIES > 1);
144
146inline constexpr auto boot_gpio_num{GPIO_NUM_0};
147
149enum class State : uint16_t {
150 // Flags (8 bits)
151 Suspended = 0u << 0u,
154
155 // Outputs
156 DCCOperations = 1u << CHAR_BIT,
157 DCCService = 2u << CHAR_BIT,
158 DECUPZpp = 3u << CHAR_BIT,
159 DECUPZsu = 4u << CHAR_BIT,
160 MDUZpp = 5u << CHAR_BIT,
161 MDUZsu = 6u << CHAR_BIT,
162 ZUSI = 7u << CHAR_BIT,
163
164 // USB protocols
165 ULF_DCC_EIN = 8u << CHAR_BIT,
166 ULF_MDU_EIN = 9u << CHAR_BIT,
167 ULF_SUSIV2 = 10u << CHAR_BIT,
168
169 // System
170 OTA = 11u << CHAR_BIT,
171};
172static_assert(std::to_underlying(State::OTA) < MAGIC_ENUM_RANGE_MAX);
173
174ZTL_MAKE_ENUM_CLASS_FLAGS(State)
175
176
177inline std::atomic<State> state{State::Suspended};
178
179namespace drv {
180
181namespace analog {
182
183inline constexpr auto ol_on_gpio_num{GPIO_NUM_17};
184
186inline constexpr auto voltage_upper_r{14300};
187
189inline constexpr auto voltage_lower_r{470};
190
192inline constexpr auto current_r{180};
193
195inline constexpr auto current_k{800};
196
197inline constexpr auto vref{1000};
198inline constexpr auto max_measurement{smath::pow(2, SOC_ADC_DIGI_MAX_BITWIDTH) -
199 1};
200inline constexpr auto voltage_channel{ADC_CHANNEL_2};
201inline constexpr auto current_channel{ADC_CHANNEL_9};
202inline constexpr auto attenuation{ADC_ATTEN_DB_0};
203inline constexpr std::array channels{current_channel, voltage_channel};
204
209inline constexpr auto sample_freq_hz{80'000u};
210
212inline constexpr auto conversion_frame_samples{1600uz};
213
215inline constexpr auto conversion_frame_time{(conversion_frame_samples * 1000u) /
217static_assert(conversion_frame_time == 20u);
218
220 SOC_ADC_DIGI_DATA_BYTES_PER_CONV};
221static_assert(conversion_frame_size == 6400uz);
224static_assert(size(channels) < SOC_ADC_PATT_LEN_MAX);
225
227inline TASK(adc_task,
228 "drv::analog::adc", // Name
229 2048uz, // Stack size
230 ESP_TASK_PRIO_MAX - 2u, // Priority
231 APP_CPU_NUM, // Core
232 200u); // Timeout
233
235inline TASK(temp_task,
236 "drv::analog::temp", // Name
237 2048uz, // Stack size
238 tskIDLE_PRIORITY, // Priority
239 APP_CPU_NUM, // Core
240 0u);
241
243 ztl::implicit_wrapper<ztl::smallest_signed_t<0, max_measurement>,
244 struct VoltageMeasurementTag>;
245
246using Voltage =
247 ztl::implicit_wrapper<VoltageMeasurement::value_type, struct VoltageTag>;
248
250 ztl::implicit_wrapper<ztl::smallest_signed_t<0, max_measurement>,
251 struct CurrentMeasurementTag>;
252
253using Current =
254 ztl::implicit_wrapper<CurrentMeasurement::value_type, struct CurrentTag>;
255
257inline struct VoltagesQueue {
259 std::array<VoltageMeasurement, conversion_frame_samples_per_channel>;
260 static constexpr auto size{1uz};
261 static inline QueueHandle_t handle{};
263
265inline struct CurrentsQueue {
267 std::array<CurrentMeasurement, conversion_frame_samples_per_channel>;
268 static constexpr auto size{1uz};
269 static inline QueueHandle_t handle{};
271
273inline struct TemperatureQueue {
274 using value_type = float;
275 static constexpr auto size{1uz};
276 static inline QueueHandle_t handle{};
278
279} // namespace analog
280
281namespace led {
282
284inline constexpr auto bug_gpio_num{GPIO_NUM_48};
285
287inline constexpr auto bug_channel{LEDC_CHANNEL_0};
288
290inline constexpr auto wifi_gpio_num{GPIO_NUM_47};
291
293inline constexpr auto wifi_channel{LEDC_CHANNEL_1};
294
295} // namespace led
296
297namespace out {
298
300inline std::array<StackType_t, 4096uz> stack{};
301
302#if !CONFIG_IDF_TARGET_LINUX
303inline gptimer_handle_t gptimer{};
304#endif
305
307inline struct RxMessageBuffer {
308 static constexpr auto size{320uz};
309 static inline MessageBufferHandle_t handle{};
311
313inline struct TxMessageBuffer {
314 static constexpr auto size{320uz};
315 static inline MessageBufferHandle_t front_handle{};
316 static inline MessageBufferHandle_t back_handle{};
318
319namespace susi {
320
321inline std::array<spi_device_handle_t, 4uz> spis{};
322
323inline constexpr auto enable_gpio_num{GPIO_NUM_4};
324inline constexpr auto clock_gpio_num{GPIO_NUM_6};
325inline constexpr auto data_gpio_num{GPIO_NUM_5};
326
327namespace zimo::zusi {
328
330inline SHARED_TASK(task,
331 "drv::out::susi::zimo::zusi", // Name
332 ESP_TASK_PRIO_MAX - 1u, // Priority
333 APP_CPU_NUM, // Core
334 0u);
335
336} // namespace zimo::zusi
337
338} // namespace susi
339
340namespace track {
341
342enum class CurrentLimit : uint8_t {
343 _500mA = 0b00u,
344 _1300mA = 0b01u,
345 _2700mA = 0b10u,
346 _4100mA = 0b11u
347};
348
350inline constexpr auto trans_queue_depth{2uz};
351
352inline constexpr auto p_gpio_num{GPIO_NUM_11};
353inline constexpr auto n_force_low_gpio_num{GPIO_NUM_9};
354
355inline constexpr auto ack_gpio_num{GPIO_NUM_18};
356inline constexpr auto nsleep_gpio_num{GPIO_NUM_8};
357inline constexpr auto ilim0_gpio_num{GPIO_NUM_15};
358inline constexpr auto ilim1_gpio_num{GPIO_NUM_16};
359inline constexpr auto nfault_gpio_num{GPIO_NUM_46};
360inline constexpr auto enable_gpio_num{GPIO_NUM_12};
361
363inline struct RxQueue {
364 struct value_type {
365 dcc::Packet packet{};
366 dcc::bidi::Datagram<> datagram{};
367 };
368 static constexpr auto size{32uz};
369 static inline QueueHandle_t handle{};
371
372inline rmt_channel_handle_t channel{};
373inline rmt_encoder_handle_t encoder{};
374
375namespace dcc {
376
377inline constexpr auto bidi_rx_gpio_num{GPIO_NUM_14};
378inline constexpr auto bidi_en_gpio_num{GPIO_NUM_13};
379
381inline SHARED_TASK(task,
382 "drv::out::track::dcc", // Name
383 ESP_TASK_PRIO_MAX - 1u, // Priority
384 APP_CPU_NUM, // Core
385 0u);
386
387} // namespace dcc
388
389namespace zimo {
390
391namespace decup {
392
394inline SHARED_TASK(task,
395 "drv::out::track::zimo::decup", // Name
396 ESP_TASK_PRIO_MAX - 1u, // Priority
397 APP_CPU_NUM, // Core
398 60'000u); // Timeout
399
400} // namespace decup
401
402namespace mdu {
403
405inline SHARED_TASK(task,
406 "drv::out::track::zimo::mdu", // Name
407 ESP_TASK_PRIO_MAX - 1u, // Priority
408 APP_CPU_NUM, // Core
409 0u);
410
411} // namespace mdu
412
413} // namespace zimo
414
415} // namespace track
416
417} // namespace out
418
419namespace wifi {
420
421#if CONFIG_IDF_TARGET_ESP32S3
422inline std::vector<wifi_ap_record_t> ap_records;
423#endif
424inline std::string ip_str;
425inline std::array<uint8_t, 6uz> mac;
426inline std::string mac_str(2uz * 6uz + 5uz + sizeof('\n'), '\0');
427
429inline TASK(task,
430 "drv::wifi", // Name
431 3072uz, // Stack size
432 tskIDLE_PRIORITY, // Priority
433 WIFI_TASK_CORE_ID, // Core
434 0u);
435
436} // namespace wifi
437
438} // namespace drv
439
440namespace intf {
441
442namespace http {
443
445inline httpd_handle_t handle{};
446
448inline constexpr auto stack_size{6144uz};
449
450namespace sta {
451
452class Server;
453inline std::shared_ptr<Server> server;
454
455} // namespace sta
456
457} // namespace http
458
459namespace mdns {
460
461inline std::string str;
462
463} // namespace mdns
464
465namespace udp {
466
467inline constexpr uint16_t port{21105u};
468inline int sock_fd;
469
470} // namespace udp
471
472namespace usb {
473
474inline constexpr auto vbus_gpio_num{GPIO_NUM_7};
475inline constexpr auto buffer_size{512uz};
476
478inline TASK(rx_task,
479 "intf::usb::rx", // Name
480 3072uz, // Stack size
481 5u, // Priority
482 APP_CPU_NUM, // Core
483 100u); // Timeout
484
486inline TASK(tx_task,
487 "intf::usb::tx", // Name
488 3072uz, // Stack size
489 1u, // Priority
490 APP_CPU_NUM, // Core
491 20u); // Timeout
492
494inline struct RxStreamBuffer {
495 static constexpr auto size{buffer_size};
496 StreamBufferHandle_t handle{};
498
500inline struct TxStreamBuffer {
501 static constexpr auto size{buffer_size};
502 StreamBufferHandle_t handle{};
504
505} // namespace usb
506
507} // namespace intf
508
509namespace mw {
510
511namespace dcc {
512
513inline constexpr auto priority_bits{5u};
514
515class Service;
516inline std::shared_ptr<Service> service;
517
519inline TASK(task,
520 "mw::dcc", // Name
521 4096uz, // Stack size
522 2u, // Priority
523 APP_CPU_NUM, // Core
524 50u); // Timeout
525
526} // namespace dcc
527
528namespace ota {
529
531inline constexpr uint8_t ack{0x06u};
532
534inline constexpr uint8_t nak{0x15u};
535
537inline TASK(task,
538 "mw::ota", // Name
539 4096uz, // Stack size
540 ESP_TASK_PRIO_MAX - 1u, // Priority
541 APP_CPU_NUM, // Core
542 0u);
543
544} // namespace ota
545
546namespace roco::z21 {
547
549inline TASK(task,
550 "mw::roco::z21", // Name
551 6144uz, // Stack size
552 5u, // Priority
553 APP_CPU_NUM, // Core
554 500u); // Timeout
555
556class Service;
557inline std::shared_ptr<Service> service;
558
559} // namespace roco::z21
560
561namespace zimo {
562
563namespace decup {
564
566inline TASK(task,
567 "mw::zimo::decup", // Name
568 4096uz, // Stack size
569 2u, // Priority
570 APP_CPU_NUM, // Core
571 drv::out::track::zimo::decup::task.timeout); // Timeout
572
573} // namespace decup
574
575namespace mdu {
576
578inline TASK(task,
579 "mw::zimo::mdu", // Name
580 4096uz, // Stack size
581 2u, // Priority
582 APP_CPU_NUM, // Core
583 0u);
584
585} // namespace mdu
586
587namespace ulf {
588
589inline std::array<StackType_t, 3072uz> stack{};
590
591namespace dcc_ein {
592
594inline SHARED_TASK(task,
595 "mw::zimo::ulf::dcc_ein", // Name
596 intf::usb::rx_task.priority - 1u, // Priority
597 APP_CPU_NUM, // Core
598 100u); // Timeout
599
600} // namespace dcc_ein
601
602namespace susiv2 {
603
605inline SHARED_TASK(task,
606 "mw::zimo::ulf::susiv2", // Name
607 intf::usb::rx_task.priority - 1u, // Priority
608 APP_CPU_NUM, // Core
609 0u);
610
611} // namespace susiv2
612
613// https://github.com/OpenRemise/Firmware/issues/36
614static_assert(dcc_ein::task.priority < intf::usb::rx_task.priority);
615static_assert(susiv2::task.priority < intf::usb::rx_task.priority);
616
617} // namespace ulf
618
619namespace zusi {
620
622inline TASK(task,
623 "mw::zimo::zusi", // Name
624 4096uz, // Stack size
625 2u, // Priority
626 APP_CPU_NUM, // Core
627 0u);
628
629} // namespace zusi
630
631} // namespace zimo
632
633} // namespace mw
Definition server.hpp:31
Definition service.hpp:31
std::atomic< State > state
Restricts access to low-level tasks.
Definition config.hpp:177
constexpr auto boot_gpio_num
BOOT pin used to boot into bootloader or resetting WiFi station settings.
Definition config.hpp:146
State
System state.
Definition config.hpp:149
@ MDUZpp
MDU ZPP update.
Definition config.hpp:160
@ DECUPZpp
DECUP ZPP update.
Definition config.hpp:158
@ DCCOperations
DCC operation mode.
Definition config.hpp:156
@ ShortCircuit
Short circuit.
Definition config.hpp:153
@ OTA
OTA update.
Definition config.hpp:170
@ ULF_DCC_EIN
ULF_DCC_EIN USB mode.
Definition config.hpp:165
@ DECUPZsu
DECUP ZSU update.
Definition config.hpp:159
@ Suspending
About to be idle.
Definition config.hpp:152
@ MDUZsu
MDU ZSU update.
Definition config.hpp:161
@ ULF_SUSIV2
ULF_SUSIV2 USB mode.
Definition config.hpp:167
@ Suspended
Idle.
Definition config.hpp:151
@ ULF_MDU_EIN
ULF_MDU_EIN USB mode.
Definition config.hpp:166
@ ZUSI
ZUSI mode.
Definition config.hpp:162
@ DCCService
DCC service mode.
Definition config.hpp:157
constexpr auto default_notify_index
Default task notification index.
Definition config.hpp:142
Definition config.hpp:181
constexpr auto conversion_frame_size
Definition config.hpp:219
constexpr auto max_measurement
Definition config.hpp:198
ztl::implicit_wrapper< ztl::smallest_signed_t< 0, max_measurement >, struct VoltageMeasurementTag > VoltageMeasurement
Definition config.hpp:242
struct drv::analog::TemperatureQueue temperature_queue
constexpr auto conversion_frame_samples_per_channel
Definition config.hpp:222
struct drv::analog::VoltagesQueue voltages_queue
constexpr auto ol_on_gpio_num
Definition config.hpp:183
ztl::implicit_wrapper< ztl::smallest_signed_t< 0, max_measurement >, struct CurrentMeasurementTag > CurrentMeasurement
Definition config.hpp:249
constexpr auto current_r
Current sense resistor.
Definition config.hpp:192
constexpr std::array channels
Definition config.hpp:203
constexpr auto attenuation
Definition config.hpp:202
constexpr auto conversion_frame_time
Time per frame [ms].
Definition config.hpp:215
constexpr auto voltage_lower_r
Voltage divider lower resistor for voltage measurement.
Definition config.hpp:189
constexpr auto current_channel
Definition config.hpp:201
constexpr auto current_k
Current sense ratio.
Definition config.hpp:195
struct drv::analog::CurrentsQueue currents_queue
constexpr auto conversion_frame_samples
Number of samples per frame.
Definition config.hpp:212
constexpr auto voltage_channel
Definition config.hpp:200
ztl::implicit_wrapper< CurrentMeasurement::value_type, struct CurrentTag > Current
Definition config.hpp:253
constexpr auto sample_freq_hz
Sample frequency [Hz] (sample takes 12.5us, conversion frame 20ms)
Definition config.hpp:209
constexpr auto voltage_upper_r
Voltage divider upper resistor for voltage measurement.
Definition config.hpp:186
ztl::implicit_wrapper< VoltageMeasurement::value_type, struct VoltageTag > Voltage
Definition config.hpp:246
constexpr auto vref
Definition config.hpp:197
Definition config.hpp:281
constexpr auto bug_gpio_num
Bug LED pin used to indicate errors or updates.
Definition config.hpp:284
constexpr auto wifi_gpio_num
WiFi LED used to indicate WiFi connection status.
Definition config.hpp:290
constexpr auto wifi_channel
WiFi LED channel.
Definition config.hpp:293
constexpr auto bug_channel
Bug LED channel.
Definition config.hpp:287
Definition config.hpp:327
Definition config.hpp:319
constexpr auto enable_gpio_num
Definition config.hpp:323
std::array< spi_device_handle_t, 4uz > spis
Definition config.hpp:321
constexpr auto data_gpio_num
Definition config.hpp:325
constexpr auto clock_gpio_num
Definition config.hpp:324
Definition config.hpp:375
constexpr auto bidi_en_gpio_num
Definition config.hpp:378
constexpr auto bidi_rx_gpio_num
Definition config.hpp:377
Definition config.hpp:391
Definition config.hpp:402
Definition config.hpp:389
Definition config.hpp:340
constexpr auto nsleep_gpio_num
Definition config.hpp:356
constexpr auto ilim1_gpio_num
Definition config.hpp:358
constexpr auto trans_queue_depth
Continuous transmission requires at least a depth of 2.
Definition config.hpp:350
constexpr auto ilim0_gpio_num
Definition config.hpp:357
constexpr auto enable_gpio_num
Definition config.hpp:360
constexpr auto ack_gpio_num
Definition config.hpp:355
rmt_encoder_handle_t encoder
Definition config.hpp:373
constexpr auto n_force_low_gpio_num
Definition config.hpp:353
constexpr auto nfault_gpio_num
Definition config.hpp:359
CurrentLimit
Definition config.hpp:342
@ _4100mA
Definition config.hpp:346
@ _1300mA
Definition config.hpp:344
@ _500mA
Definition config.hpp:343
@ _2700mA
Definition config.hpp:345
rmt_channel_handle_t channel
Definition config.hpp:372
constexpr auto p_gpio_num
Definition config.hpp:352
struct drv::out::track::RxQueue rx_queue
Definition config.hpp:297
struct drv::out::TxMessageBuffer tx_message_buffer
std::array< StackType_t, 4096uz > stack
Definition config.hpp:300
struct drv::out::RxMessageBuffer rx_message_buffer
gptimer_handle_t gptimer
Definition config.hpp:303
Definition config.hpp:419
std::array< uint8_t, 6uz > mac
Definition config.hpp:425
std::string ip_str
Definition config.hpp:424
std::string mac_str(2uz *6uz+5uz+sizeof('\n'), '\0')
Definition config.hpp:179
Definition config.hpp:450
std::shared_ptr< Server > server
Definition config.hpp:453
Definition config.hpp:442
httpd_handle_t handle
Handle to server instance.
Definition config.hpp:445
constexpr auto stack_size
Definition config.hpp:448
Definition config.hpp:459
std::string str
Definition config.hpp:461
Definition config.hpp:465
constexpr uint16_t port
Definition config.hpp:467
int sock_fd
Definition config.hpp:468
Definition config.hpp:472
constexpr auto buffer_size
Definition config.hpp:475
struct intf::usb::RxStreamBuffer rx_stream_buffer
constexpr auto vbus_gpio_num
Definition config.hpp:474
struct intf::usb::TxStreamBuffer tx_stream_buffer
Definition config.hpp:440
Definition config.hpp:511
constexpr auto priority_bits
Definition config.hpp:513
std::shared_ptr< Service > service
Definition config.hpp:516
Definition config.hpp:528
constexpr uint8_t nak
Definition config.hpp:534
constexpr uint8_t ack
Definition config.hpp:531
Definition config.hpp:546
std::shared_ptr< Service > service
Definition config.hpp:557
Definition config.hpp:563
Definition config.hpp:575
Definition config.hpp:591
Definition config.hpp:602
Definition config.hpp:587
std::array< StackType_t, 3072uz > stack
Definition config.hpp:589
Definition config.hpp:619
Definition config.hpp:561
Definition config.hpp:509
Definition config.hpp:265
static QueueHandle_t handle
Definition config.hpp:269
std::array< CurrentMeasurement, conversion_frame_samples_per_channel > value_type
Definition config.hpp:266
static constexpr auto size
Definition config.hpp:268
Definition config.hpp:273
float value_type
Definition config.hpp:274
static constexpr auto size
Definition config.hpp:275
static QueueHandle_t handle
Definition config.hpp:276
Definition config.hpp:257
static constexpr auto size
Definition config.hpp:260
static QueueHandle_t handle
Definition config.hpp:261
std::array< VoltageMeasurement, conversion_frame_samples_per_channel > value_type
Definition config.hpp:258
Definition config.hpp:307
static constexpr auto size
Definition config.hpp:308
static MessageBufferHandle_t handle
Definition config.hpp:309
Definition config.hpp:313
static MessageBufferHandle_t back_handle
Definition config.hpp:316
static constexpr auto size
Definition config.hpp:314
static MessageBufferHandle_t front_handle
Definition config.hpp:315
Definition config.hpp:364
dcc::Packet packet
Definition config.hpp:365
dcc::bidi::Datagram datagram
Definition config.hpp:366
Definition config.hpp:363
static QueueHandle_t handle
Definition config.hpp:369
static constexpr auto size
Definition config.hpp:368
Definition config.hpp:494
StreamBufferHandle_t handle
Definition config.hpp:496
static constexpr auto size
Definition config.hpp:495
Definition config.hpp:500
StreamBufferHandle_t handle
Definition config.hpp:502
static constexpr auto size
Definition config.hpp:501
Task macros.
#define SHARED_TASK(OBJECT, NAME, PRIORITY, CORE_ID, TIMEOUT)
Create shared task.
Definition task.hpp:82
#define TASK(OBJECT, NAME, STACK_SIZE, PRIORITY, CORE_ID, TIMEOUT)
Create task.
Definition task.hpp:69