Skip to content

Commit

Permalink
fixup! spi: Implement SpiBus
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Jan 6, 2025
1 parent 3a3cf55 commit d9cf856
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/spi/for_embedded_hal_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,14 @@ impl ErrorType for SpiBus {
type Error = Infallible;
}

// In RIOT, there is no type-level distinction between a bus and a device -- if it's acquired with
// GPIO_UNDEF as the CS pin, it matches the SpiBus pattern, and if it has a pin in it, it matches
// the SpiDevice pattern. (The distinction of whether something is owned exclusively or not can not
// be made in RIOT as it has no concept of exclusive device ownership.)
//
// To avoid re-implementing everything and especially the split transfer logic, this is hooking
// into the transaction function, which is largely modeled after SpiDevice's API.
// into the transaction function, which is largely modeled after the HAL SpiDevice's API (taking an
// Operations list like SpiDeivce::transaction()).
//
// This may or may not be efficient depending on what the compiler inlines, but really, if you want
// efficient, go with SpiDevice anyway for hardware CS. Another downside of this approach is that
Expand Down

0 comments on commit d9cf856

Please sign in to comment.