tone-generator/dac.hpp

17 lines
156 B
C++
Raw Normal View History

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-19 22:43:24 +10:00
}
inline void set(int v) {
PORTD = clamp(v, 0, 255);
2024-08-19 22:43:24 +10:00
}
};