diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-12-15 00:21:34 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2012-12-15 00:21:34 +0100 |
commit | 379a2d1615b64e251f0f5bcfd9fce0bc7b706982 (patch) | |
tree | 6df3f64b736097e6509bc38e9908abac2db8e1ce | |
parent | 5be48c81ef2958f9e1caaa5273f972f517bcd460 (diff) |
Fixed DAC reset configuration.
-rw-r--r-- | main.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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)); |