From f9cae6ab0f8f8d510605baf0a5bf10d482cb1a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3r=C3=A1nt=20Pint=C3=A9r?= Date: Sun, 27 Oct 2024 23:27:21 +0100 Subject: [PATCH] Document pins --- main/devices/Pin.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/devices/Pin.hpp b/main/devices/Pin.hpp index 444ccfa5..d11d343a 100644 --- a/main/devices/Pin.hpp +++ b/main/devices/Pin.hpp @@ -18,6 +18,11 @@ using PinPtr = std::shared_ptr; class InternalPin; using InternalPinPtr = std::shared_ptr; +/** + * @brief A GPIO pin abstraction that allows digital reads and writes. + * + * @details This can be implemented by internal pins (GPIO pins of the MCU) or external pins provided by external peripherals. + */ class Pin { public: static PinPtr byName(const String& name) { @@ -55,6 +60,9 @@ class Pin { std::map Pin::BY_NAME; +/** + * @brief An internal GPIO pin of the MCU. These pins can do analog reads as well, and can expose the GPIO number. + */ class InternalPin : public Pin { public: static InternalPinPtr registerPin(const String& name, gpio_num_t gpio) {