Skip to content

Commit

Permalink
Add a note about the macro in the transaction method docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantM11235 committed Sep 20, 2022
1 parent 6c9f380 commit 5842633
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions embedded-hal-async/src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5842633

Please sign in to comment.