summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/main.cpp b/main.cpp
index 13dac75..c7dc04e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -83,18 +83,16 @@ auto conf_desc = configuration_desc(2, 1, 0, 0xc0, 0,
);
class DAC {
- Pin& reset;
+ Pin& nreset;
I2C& i2c;
public:
- DAC(Pin& _reset, I2C& _i2c) : reset(_reset), i2c(_i2c) {
- reset.set_mode(Pin::Output);
- reset.off();
- }
-
+ DAC(Pin& _nreset, I2C& _i2c) : nreset(_nreset), i2c(_i2c) {}
+
void init() {
// Configure CS43L22.
- reset.on();
+ nreset.set_mode(Pin::Output);
+ nreset.on();
i2c.write_reg(0x4a, 0x02, 0x9e);
i2c.write_reg(0x4a, 0x06, (0 << 7) | (1 << 6) | (0 << 4) | (1 << 2) | (3 << 0));