From 379a2d1615b64e251f0f5bcfd9fce0bc7b706982 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 15 Dec 2012 00:21:34 +0100 Subject: Fixed DAC reset configuration. --- main.cpp | 12 +++++------- 1 file 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)); -- cgit v1.2.3