From 327245ce604b1ec0efa1218972d9ff64e888ed0a Mon Sep 17 00:00:00 2001 From: Samuel Tardieu <sam@rfc1149.net> Date: Wed, 10 Jul 2024 14:59:50 +0200 Subject: [PATCH] Add documentation --- i2c2-target/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i2c2-target/src/lib.rs b/i2c2-target/src/lib.rs index c0fcdfe..d96531c 100644 --- a/i2c2-target/src/lib.rs +++ b/i2c2-target/src/lib.rs @@ -150,6 +150,10 @@ impl I2C2 { } } + /// Install a callback which will be called whenever an I²C + /// request arrives. This callback will decide which bytes are + /// sent back if a read request follows. The read operation will + /// be completed by zeroes as needed. pub fn set_callback(callback: Callback) { unsafe { STATE.callback = Some(callback) }; } -- GitLab