summaryrefslogtreecommitdiff
path: root/avr/1wire.c
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2016-01-24 23:10:24 +0100
committerFlorian Jung <flo@windfisch.org>2016-01-24 23:10:24 +0100
commited35d40a612633c3545a6cd7e59e3e432c623dfc (patch)
treee0bb7619ad1f7da7c33523e0b74e4b542c1eeead /avr/1wire.c
parent07ce2df5da6265702e1d99556f46139f8b5b8611 (diff)
actually commit the write
Diffstat (limited to 'avr/1wire.c')
-rw-r--r--avr/1wire.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/avr/1wire.c b/avr/1wire.c
index 54c8dcc..72722df 100644
--- a/avr/1wire.c
+++ b/avr/1wire.c
@@ -238,6 +238,16 @@ uint8_t ds1992_scratch_verify(uint16_t addr, const uint8_t* buf, uint8_t len, ui
return status;
}
+void ds1992_scratch_copy(uint16_t addr, uint8_t es_reg)
+{
+ w1_byte_wr(SKIP_ROM);
+ w1_byte_wr(0x55); // copy scratchpad to memory
+ w1_byte_wr((addr & 0x00FF));
+ w1_byte_wr((addr & 0xFF00) >> 8);
+ w1_byte_wr(es_reg);
+
+ while(w1_byte_rd() != 0);
+}
void w1_command( uint8_t command, uint8_t *id )
{