Library for MCP4822 SPI 12-bit DAC, both outputs supported, nLDAC connected to GND.
Diff: MCP4822.cpp
- Revision:
- 1:5c1e0d492b59
- Parent:
- 0:014a10a4fed1
- Child:
- 11:96eff565b2c0
--- a/MCP4822.cpp Fri Jan 21 10:55:58 2011 +0000 +++ b/MCP4822.cpp Fri Jan 21 11:07:34 2011 +0000 @@ -50,17 +50,4 @@ _spi.write(ValueB); _ncs = 1; return; -} - -void MCP4822::writeAB(int ValueAB) { - _ncs = 0; - ValueAB = ValueAB &= 0x0FFF; - ValueAB = ValueAB |= 0x1000; - _spi.write(ValueAB); - _ncs = 1; - wait_us(500); - _ncs = 0; - ValueAB = ValueAB |= 0x9000; - _spi.write(ValueAB); - _ncs = 1; } \ No newline at end of file