|
|
|
@ -7,7 +7,16 @@ MCP4725::MCP4725(pwrd_md power_down_mode,
|
|
|
|
|
address(address),
|
|
|
|
|
i2c_write(i2c_write)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
uint8_t temp[6];
|
|
|
|
|
|
|
|
|
|
temp[0] = write_dac_and_eeprom | (power_down_mode << 1);
|
|
|
|
|
temp[1] = static_cast<uint8_t>(dac_value >> 4);
|
|
|
|
|
temp[2] = static_cast<uint8_t>(dac_value << 4);
|
|
|
|
|
temp[3] = temp[0];
|
|
|
|
|
temp[4] = temp[1];
|
|
|
|
|
temp[5] = temp[2];
|
|
|
|
|
|
|
|
|
|
i2c_write(temp,6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MCP4725::MCP4725(i2c_addr address,
|
|
|
|
@ -15,8 +24,17 @@ MCP4725::MCP4725(i2c_addr address,
|
|
|
|
|
power_down_mode(MCP4725::normal),
|
|
|
|
|
address(address),
|
|
|
|
|
i2c_write(i2c_write)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
uint8_t temp[6];
|
|
|
|
|
|
|
|
|
|
temp[0] = write_dac_and_eeprom | (power_down_mode << 1);
|
|
|
|
|
temp[1] = static_cast<uint8_t>(dac_value >> 4);
|
|
|
|
|
temp[2] = static_cast<uint8_t>(dac_value << 4);
|
|
|
|
|
temp[3] = temp[0];
|
|
|
|
|
temp[4] = temp[1];
|
|
|
|
|
temp[5] = temp[2];
|
|
|
|
|
|
|
|
|
|
i2c_write(temp,6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MCP4725::~MCP4725()
|
|
|
|
|