aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp
diff options
context:
space:
mode:
authorValentin Trophime <[email protected]>2025-11-12 13:19:42 +0100
committerValentin Trophime <[email protected]>2025-11-12 13:38:00 +0100
commitd4e2caab31c1e9802120141cebc0a00b04471c16 (patch)
tree21e119bd714004ee07065ac7a56c3899f257e69a /embassy-rp
parent7201c6deb9d8c2b1fb380a58b9e879e394ed5f24 (diff)
Add docs for embassy-rp::pio::get_x assumption about autopush.
Diffstat (limited to 'embassy-rp')
-rw-r--r--embassy-rp/CHANGELOG.md2
-rw-r--r--embassy-rp/src/pio/instr.rs16
2 files changed, 18 insertions, 0 deletions
diff --git a/embassy-rp/CHANGELOG.md b/embassy-rp/CHANGELOG.md
index 3b3cb5351..4b0d738a7 100644
--- a/embassy-rp/CHANGELOG.md
+++ b/embassy-rp/CHANGELOG.md
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8<!-- next-header --> 8<!-- next-header -->
9## Unreleased - ReleaseDate 9## Unreleased - ReleaseDate
10 10
11- Add documentation for pio `get_x` about autopush.
11- Fix several minor typos in documentation 12- Fix several minor typos in documentation
12- Add PIO SPI 13- Add PIO SPI
13- Add PIO I2S input 14- Add PIO I2S input
@@ -114,3 +115,4 @@ Small release fixing a few gnarly bugs, upgrading is strongly recommended.
114- rename the Channel trait to Slice and the PwmPin to PwmChannel 115- rename the Channel trait to Slice and the PwmPin to PwmChannel
115- i2c: Fix race condition that appears on fast repeated transfers. 116- i2c: Fix race condition that appears on fast repeated transfers.
116- Add a basic "read to break" function 117- Add a basic "read to break" function
118
diff --git a/embassy-rp/src/pio/instr.rs b/embassy-rp/src/pio/instr.rs
index b15d507de..304ddb20a 100644
--- a/embassy-rp/src/pio/instr.rs
+++ b/embassy-rp/src/pio/instr.rs
@@ -5,6 +5,10 @@ use crate::pio::{Instance, StateMachine};
5 5
6impl<'d, PIO: Instance, const SM: usize> StateMachine<'d, PIO, SM> { 6impl<'d, PIO: Instance, const SM: usize> StateMachine<'d, PIO, SM> {
7 /// Set value of scratch register X. 7 /// Set value of scratch register X.
8 ///
9 /// SAFETY: autopull enabled else it will write undefined data.
10 /// Make sure to have setup the according configuration see
11 /// [shift_out](crate::pio::Config::shift_out) and [auto_fill](crate::pio::ShiftConfig::auto_fill).
8 pub unsafe fn set_x(&mut self, value: u32) { 12 pub unsafe fn set_x(&mut self, value: u32) {
9 const OUT: u16 = InstructionOperands::OUT { 13 const OUT: u16 = InstructionOperands::OUT {
10 destination: OutDestination::X, 14 destination: OutDestination::X,
@@ -16,6 +20,10 @@ impl<'d, PIO: Instance, const SM: usize> StateMachine<'d, PIO, SM> {
16 } 20 }
17 21
18 /// Get value of scratch register X. 22 /// Get value of scratch register X.
23 ///
24 /// SAFETY: autopush enabled else it will read undefined data.
25 /// Make sure to have setup the according configurations see
26 /// [shift_in](crate::pio::Config::shift_in) and [auto_fill](crate::pio::ShiftConfig::auto_fill).
19 pub unsafe fn get_x(&mut self) -> u32 { 27 pub unsafe fn get_x(&mut self) -> u32 {
20 const IN: u16 = InstructionOperands::IN { 28 const IN: u16 = InstructionOperands::IN {
21 source: InSource::X, 29 source: InSource::X,
@@ -27,6 +35,10 @@ impl<'d, PIO: Instance, const SM: usize> StateMachine<'d, PIO, SM> {
27 } 35 }
28 36
29 /// Set value of scratch register Y. 37 /// Set value of scratch register Y.
38 ///
39 /// SAFETY: autopull enabled else it will write undefined data.
40 /// Make sure to have setup the according configuration see
41 /// [shift_out](crate::pio::Config::shift_out) and [auto_fill](crate::pio::ShiftConfig::auto_fill).
30 pub unsafe fn set_y(&mut self, value: u32) { 42 pub unsafe fn set_y(&mut self, value: u32) {
31 const OUT: u16 = InstructionOperands::OUT { 43 const OUT: u16 = InstructionOperands::OUT {
32 destination: OutDestination::Y, 44 destination: OutDestination::Y,
@@ -38,6 +50,10 @@ impl<'d, PIO: Instance, const SM: usize> StateMachine<'d, PIO, SM> {
38 } 50 }
39 51
40 /// Get value of scratch register Y. 52 /// Get value of scratch register Y.
53 ///
54 /// SAFETY: autopush enabled else it will read undefined data.
55 /// Make sure to have setup the according configurations see
56 /// [shift_in](crate::pio::Config::shift_in) and [auto_fill](crate::pio::ShiftConfig::auto_fill).
41 pub unsafe fn get_y(&mut self) -> u32 { 57 pub unsafe fn get_y(&mut self) -> u32 {
42 const IN: u16 = InstructionOperands::IN { 58 const IN: u16 = InstructionOperands::IN {
43 source: InSource::Y, 59 source: InSource::Y,