From 5fe9dd5a5036e528d6180ef629d38d454e4744a3 Mon Sep 17 00:00:00 2001 From: Arksine Date: Thu, 9 Jan 2020 19:24:51 -0500 Subject: [PATCH] avr: implement i2c_read Signed-off-by: Eric Callahan --- src/avr/i2c.c | 19 ++++++++++++++++++- src/i2ccmds.c | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) 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<i2c_config, reg_len, reg, data_len, data);