2024-08-19 22:43:24 +10:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "util.hpp"
|
|
|
|
|
|
|
|
namespace dac {
|
|
|
|
|
|
|
|
inline void init() {
|
2024-08-25 16:53:23 +10:00
|
|
|
DDRD = 0xff;
|
2024-08-28 13:10:57 +10:00
|
|
|
PORTD = 127;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void reset() {
|
|
|
|
PORTD = 127;
|
2024-08-19 22:43:24 +10:00
|
|
|
}
|
|
|
|
|
2024-08-26 13:02:17 +10:00
|
|
|
inline void set(int v) {
|
|
|
|
PORTD = clamp(v, 0, 255);
|
2024-08-19 22:43:24 +10:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|