From 93b7106e0a29298a94f39e190d36acbaed2a0deb Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Sun, 5 Nov 2023 20:40:49 +0000 Subject: [PATCH] Document default value for ShiftDirection It's different from the reset value, which can easily be missed when porting code from the C SDK. --- rp2040-hal/src/pio.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rp2040-hal/src/pio.rs b/rp2040-hal/src/pio.rs index e72e25fc3..6343a1845 100644 --- a/rp2040-hal/src/pio.rs +++ b/rp2040-hal/src/pio.rs @@ -1933,6 +1933,10 @@ pub enum InstallError { impl PIOBuilder

{ /// Set config settings based on information from the given [`pio::Program`]. /// Additional configuration may be needed in addition to this. + /// + /// Note: The shift direction for both input and output shift registers + /// defaults to `ShiftDirection::Left`, which is different from the + /// rp2040 reset value. pub fn from_program(p: InstalledProgram

) -> Self { PIOBuilder { clock_divisor: (1, 0),