From 584263305a922332bbd77bb6f16245138cd2eac0 Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Tue, 20 Sep 2022 17:46:22 -0500 Subject: [PATCH] Add a note about the macro in the transaction method docs --- embedded-hal-async/src/spi.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/embedded-hal-async/src/spi.rs b/embedded-hal-async/src/spi.rs index efb2224fc..d521b11b9 100644 --- a/embedded-hal-async/src/spi.rs +++ b/embedded-hal-async/src/spi.rs @@ -160,6 +160,10 @@ pub unsafe trait SpiDevice: ErrorType { /// Perform a transaction against the device. /// + /// **NOTE:** + /// It is not recommended to use this method directly, because it requires `unsafe` code to dereference the raw pointer. + /// Instead, the [`transaction!`] macro should be used, which handles this safely inside the macro. + /// /// - Locks the bus /// - Asserts the CS (Chip Select) pin. /// - Calls `f` with an exclusive reference to the bus, which can then be used to do transfers against the device.