From 6505a91a77d4efcc6d54b35851abcb137cdca30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 14 Aug 2020 11:23:45 +0200 Subject: hw/sd: Add sdbus_read_data() to read multiples bytes on the data line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a sdbus_read_data() method to read multiple bytes on the data line of a SD bus. We might improve the tracing later, for now keep logging each byte individually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-7-f4bug@amsat.org> --- include/hw/sd/sd.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/hw/sd/sd.h') diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 3ae3e8939b..ac02d61a7a 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -184,6 +184,15 @@ uint8_t sdbus_read_byte(SDBus *sd); * Write multiple bytes of data on the data lines of a SD bus. */ void sdbus_write_data(SDBus *sdbus, const void *buf, size_t length); +/** + * Read data from a SD bus. + * @sdbus: bus + * @buf: buffer to read data into + * @length: number of bytes to read + * + * Read multiple bytes of data on the data lines of a SD bus. + */ +void sdbus_read_data(SDBus *sdbus, void *buf, size_t length); bool sdbus_data_ready(SDBus *sd); bool sdbus_get_inserted(SDBus *sd); bool sdbus_get_readonly(SDBus *sd); -- cgit v1.2.3