/* Write scratch pad, read back, then copy to eeprom  */
static int ds18b20_write_scratchpad(const struct device *dev, struct ds18b20_scratchpad scratchpad)
/* Write scratch pad, read back, then copy to eeprom  */
static int ds18b20_write_scratchpad(const struct device *dev, struct ds18b20_scratchpad scratchpad)
{
	struct ds18b20_data *data = dev->data;
	const struct device *bus = ds18b20_bus(dev);
	uint8_t sp_data[4] = {
		DS18B20_CMD_WRITE_SCRATCHPAD,
		scratchpad.alarm_temp_high,
		scratchpad.alarm_temp_low,
		scratchpad.config
	};
	return w1_write_read(bus, &data->config, sp_data, sizeof(sp_data), NULL, 0);
}