|
|
|
@ -9,7 +9,7 @@ MCP4725::MCP4725(pwrd_md power_down_mode,
|
|
|
|
|
{
|
|
|
|
|
uint8_t temp[6];
|
|
|
|
|
|
|
|
|
|
temp[0] = write_dac_and_eeprom | (power_down_mode << 1);
|
|
|
|
|
temp[0] = cmd_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];
|
|
|
|
@ -27,7 +27,7 @@ MCP4725::MCP4725(i2c_addr address,
|
|
|
|
|
{
|
|
|
|
|
uint8_t temp[6];
|
|
|
|
|
|
|
|
|
|
temp[0] = write_dac_and_eeprom | (power_down_mode << 1);
|
|
|
|
|
temp[0] = cmd_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];
|
|
|
|
@ -47,7 +47,7 @@ void MCP4725::operator=(uint16_t dac_value)
|
|
|
|
|
uint8_t temp[3];
|
|
|
|
|
this.dac_value = dac_value;
|
|
|
|
|
|
|
|
|
|
temp[0] = write_dac | (power_down_mode << 1);
|
|
|
|
|
temp[0] = cmd_write_dac | (power_down_mode << 1);
|
|
|
|
|
temp[1] = static_cast<uint8_t>(dac_value >> 4);
|
|
|
|
|
temp[2] = static_cast<uint8_t>(dac_value << 4);
|
|
|
|
|
|
|
|
|
@ -60,7 +60,7 @@ void MCP4725::operator==(uint16_t dac_and_eeprom_value)
|
|
|
|
|
dac_value = dac_and_eeprom_value;
|
|
|
|
|
eeprom_value = dac_value;
|
|
|
|
|
|
|
|
|
|
temp[0] = write_dac_and_eeprom | (power_down_mode << 1);
|
|
|
|
|
temp[0] = cmd_write_dac_and_eeprom | (power_down_mode << 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MCP4725::write_dac(uint16_t dac_value)
|
|
|
|
|