11#include "sygsp-button.hpp"
13namespace sygaldry {
namespace sygsr {
27template<
unsigned int pin_number, sygsp::ButtonActive active_level = sygsp::ButtonActive::Low>
32,
copyright_<"Copyright 2023 Sygaldry Contributors">
33,
license_<"SPDX-License-Identifier: MIT">
36 static_assert(0 <= pin_number && pin_number <= 29);
40 gpio_init(pin_number);
41 gpio_set_dir(pin_number,
false);
42 if constexpr (active_level == sygsp::ButtonActive::Low) gpio_pull_up(pin_number);
43 else gpio_pull_down(pin_number);
48 inputs.button_state = (char)gpio_get(pin_number) == (char)active_level;
49 ButtonGestureModel::operator()();
Document the author of an entity, e.g. a component or binding.
Definition sygah-metadata.hpp:39
Document the copyright statement of an entity, e.g. a component or binding.
Definition sygah-metadata.hpp:47
Document a textual description of an entity, e.g. an endpoint, component or binding.
Definition sygah-metadata.hpp:35
Document the copyright license of an entity, e.g. a component or binding.
Definition sygah-metadata.hpp:45
Document the name of an entity, e.g. an endpoint, component, or binding.
Definition sygah-metadata.hpp:33
Document a textual description of the version number of an entity, e.g. a component or binding.
Definition sygah-metadata.hpp:51