2025-08-03 00:34:05 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
class Pin {
|
|
|
|
|
public:
|
|
|
|
|
Pin(int pinNumber, bool isOutput = true, bool isLed = false, uint32_t ledFrequency = 5000, uint8_t ledChannel = 0);
|
|
|
|
|
void setHigh();
|
|
|
|
|
void setLow();
|
|
|
|
|
void setLedLevel(uint32_t level);
|
2025-08-27 17:30:39 +02:00
|
|
|
uint32_t getLedLevel() const;
|
|
|
|
|
const uint8_t getLedResolutionBits() const;
|
2025-08-03 00:34:05 +02:00
|
|
|
bool read();
|
|
|
|
|
int getPinNumber() const;
|
|
|
|
|
bool isOutput() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
uint8_t ledChannel = 0; // LED channel for PWM
|
|
|
|
|
uint8_t pinNumber;
|
2025-08-27 17:30:39 +02:00
|
|
|
uint32_t ledLevel = 0;
|
|
|
|
|
const uint8_t ledResolutionBits = 12;
|
2025-08-03 00:34:05 +02:00
|
|
|
bool output;
|
|
|
|
|
bool isLed = false; // Flag to indicate if this pin is used for LED control
|
|
|
|
|
};
|