aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-rp')
-rw-r--r--embassy-rp/src/gpio.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index 9b5faac15..f79bf8948 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -26,6 +26,7 @@ static QSPI_WAKERS: [AtomicWaker; QSPI_PIN_COUNT] = [const { AtomicWaker::new()
26 26
27/// Represents a digital input or output level. 27/// Represents a digital input or output level.
28#[derive(Debug, Eq, PartialEq, Clone, Copy)] 28#[derive(Debug, Eq, PartialEq, Clone, Copy)]
29#[cfg_attr(feature = "defmt", derive(defmt::Format))]
29pub enum Level { 30pub enum Level {
30 /// Logical low. 31 /// Logical low.
31 Low, 32 Low,
@@ -53,6 +54,7 @@ impl From<Level> for bool {
53 54
54/// Represents a pull setting for an input. 55/// Represents a pull setting for an input.
55#[derive(Debug, Clone, Copy, Eq, PartialEq)] 56#[derive(Debug, Clone, Copy, Eq, PartialEq)]
57#[cfg_attr(feature = "defmt", derive(defmt::Format))]
56pub enum Pull { 58pub enum Pull {
57 /// No pull. 59 /// No pull.
58 None, 60 None,
@@ -64,6 +66,7 @@ pub enum Pull {
64 66
65/// Drive strength of an output 67/// Drive strength of an output
66#[derive(Debug, Eq, PartialEq)] 68#[derive(Debug, Eq, PartialEq)]
69#[cfg_attr(feature = "defmt", derive(defmt::Format))]
67pub enum Drive { 70pub enum Drive {
68 /// 2 mA drive. 71 /// 2 mA drive.
69 _2mA, 72 _2mA,
@@ -76,6 +79,7 @@ pub enum Drive {
76} 79}
77/// Slew rate of an output 80/// Slew rate of an output
78#[derive(Debug, Eq, PartialEq)] 81#[derive(Debug, Eq, PartialEq)]
82#[cfg_attr(feature = "defmt", derive(defmt::Format))]
79pub enum SlewRate { 83pub enum SlewRate {
80 /// Fast slew rate. 84 /// Fast slew rate.
81 Fast, 85 Fast,
@@ -85,6 +89,7 @@ pub enum SlewRate {
85 89
86/// A GPIO bank with up to 32 pins. 90/// A GPIO bank with up to 32 pins.
87#[derive(Debug, Eq, PartialEq)] 91#[derive(Debug, Eq, PartialEq)]
92#[cfg_attr(feature = "defmt", derive(defmt::Format))]
88pub enum Bank { 93pub enum Bank {
89 /// Bank 0. 94 /// Bank 0.
90 Bank0 = 0, 95 Bank0 = 0,
@@ -108,6 +113,8 @@ pub struct DormantWakeConfig {
108} 113}
109 114
110/// GPIO input driver. 115/// GPIO input driver.
116#[derive(Debug)]
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
111pub struct Input<'d> { 118pub struct Input<'d> {
112 pin: Flex<'d>, 119 pin: Flex<'d>,
113} 120}
@@ -358,6 +365,8 @@ impl<'d> Future for InputFuture<'d> {
358} 365}
359 366
360/// GPIO output driver. 367/// GPIO output driver.
368#[derive(Debug)]
369#[cfg_attr(feature = "defmt", derive(defmt::Format))]
361pub struct Output<'d> { 370pub struct Output<'d> {
362 pin: Flex<'d>, 371 pin: Flex<'d>,
363} 372}
@@ -445,6 +454,8 @@ impl<'d> Output<'d> {
445} 454}
446 455
447/// GPIO output open-drain. 456/// GPIO output open-drain.
457#[derive(Debug)]
458#[cfg_attr(feature = "defmt", derive(defmt::Format))]
448pub struct OutputOpenDrain<'d> { 459pub struct OutputOpenDrain<'d> {
449 pin: Flex<'d>, 460 pin: Flex<'d>,
450} 461}
@@ -592,6 +603,8 @@ impl<'d> OutputOpenDrain<'d> {
592/// This pin can be either an input or output pin. The output level register bit will remain 603/// This pin can be either an input or output pin. The output level register bit will remain
593/// set while not in output mode, so the pin's level will be 'remembered' when it is not in output 604/// set while not in output mode, so the pin's level will be 'remembered' when it is not in output
594/// mode. 605/// mode.
606#[derive(Debug)]
607#[cfg_attr(feature = "defmt", derive(defmt::Format))]
595pub struct Flex<'d> { 608pub struct Flex<'d> {
596 pin: Peri<'d, AnyPin>, 609 pin: Peri<'d, AnyPin>,
597} 610}
@@ -864,6 +877,8 @@ impl<'d> Drop for Flex<'d> {
864} 877}
865 878
866/// Dormant wake driver. 879/// Dormant wake driver.
880#[derive(Debug)]
881#[cfg_attr(feature = "defmt", derive(defmt::Format))]
867pub struct DormantWake<'w> { 882pub struct DormantWake<'w> {
868 pin: Peri<'w, AnyPin>, 883 pin: Peri<'w, AnyPin>,
869 cfg: DormantWakeConfig, 884 cfg: DormantWakeConfig,