Skip to content

Commit

Permalink
Document pins
Browse files Browse the repository at this point in the history
  • Loading branch information
lptr committed Oct 27, 2024
1 parent e296398 commit f9cae6a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main/devices/Pin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ using PinPtr = std::shared_ptr<Pin>;
class InternalPin;
using InternalPinPtr = std::shared_ptr<InternalPin>;

/**
* @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) {
Expand Down Expand Up @@ -55,6 +60,9 @@ class Pin {

std::map<String, PinPtr> 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) {
Expand Down

0 comments on commit f9cae6a

Please sign in to comment.