diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-30 20:48:40 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-30 20:48:40 +1000 |
| commit | 371f0a20cad4dfcb3237db6f72a7e35403950938 (patch) | |
| tree | 48240a9c3d2121095e0f10537228603120435dd0 /src/drivers/include/digital_pot.hpp | |
| parent | 0347555d5b2314e1be58261ef29fa13a76c039e6 (diff) | |
| download | tangara-fw-371f0a20cad4dfcb3237db6f72a7e35403950938.tar.gz | |
Clean up gpios interface
Diffstat (limited to 'src/drivers/include/digital_pot.hpp')
| -rw-r--r-- | src/drivers/include/digital_pot.hpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/drivers/include/digital_pot.hpp b/src/drivers/include/digital_pot.hpp deleted file mode 100644 index e2ca00b1..00000000 --- a/src/drivers/include/digital_pot.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2023 jacqueline <me@jacqueline.id.au> - * - * SPDX-License-Identifier: GPL-3.0-only - */ - -#pragma once - -#include <stdint.h> -#include <functional> - -#include "esp_err.h" -#include "result.hpp" - -#include "gpio_expander.hpp" - -namespace drivers { - -/* - * Driver for a two-channel digital potentiometer, with steps measured in - * decibels. - */ -class DigitalPot { - public: - explicit DigitalPot(GpioExpander* gpios); - ~DigitalPot() {} - - // Not copyable or movable. - DigitalPot(const DigitalPot&) = delete; - DigitalPot& operator=(const DigitalPot&) = delete; - - enum class Channel { - kLeft, - kRight, - }; - - auto SetRelative(int_fast8_t change) -> void; - auto SetRelative(Channel ch, int_fast8_t change) -> void; - - auto SetZeroCrossDetect(bool enabled) -> void; - - auto GetMaxAttenuation() -> int_fast8_t; - auto GetMinAttenuation() -> int_fast8_t; - - private: - GpioExpander* gpios_; -}; - -} // namespace drivers |
