From 5fe9dd5a5036e528d6180ef629d38d454e4744a3 Mon Sep 17 00:00:00 2001 From: Arksine Date: Thu, 9 Jan 2020 19:24:51 -0500 Subject: avr: implement i2c_read Signed-off-by: Eric Callahan --- src/avr/i2c.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/avr') diff --git a/src/avr/i2c.c b/src/avr/i2c.c index 4632497e..370582cc 100644 --- a/src/avr/i2c.c +++ b/src/avr/i2c.c @@ -84,6 +84,14 @@ i2c_send_byte(uint8_t b, uint32_t timeout) i2c_wait(timeout); } +static void +i2c_receive_byte(uint8_t *read, uint32_t timeout, uint8_t send_ack) +{ + TWCR = (1<