diff options
| author | Ralph Ursprung <[email protected]> | 2025-07-23 16:56:34 +0200 |
|---|---|---|
| committer | Ralph Ursprung <[email protected]> | 2025-07-23 16:56:34 +0200 |
| commit | 978a007baf4e1ef345af7b7e622cecd1fc01e415 (patch) | |
| tree | 3666f08da2465a2125ab7f9ca0e67c98fb5ac010 /embassy-rp | |
| parent | f63e2fe7d41ad8939eea9525a83f6b60472b6f4f (diff) | |
add missing `Debug` and `defmt::Format` derives for `embassy_rp::gpio`
Diffstat (limited to 'embassy-rp')
| -rw-r--r-- | embassy-rp/src/gpio.rs | 15 |
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))] | ||
| 29 | pub enum Level { | 30 | pub 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))] | ||
| 56 | pub enum Pull { | 58 | pub 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))] | ||
| 67 | pub enum Drive { | 70 | pub 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))] | ||
| 79 | pub enum SlewRate { | 83 | pub 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))] | ||
| 88 | pub enum Bank { | 93 | pub 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))] | ||
| 111 | pub struct Input<'d> { | 118 | pub 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))] | ||
| 361 | pub struct Output<'d> { | 370 | pub 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))] | ||
| 448 | pub struct OutputOpenDrain<'d> { | 459 | pub 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))] | ||
| 595 | pub struct Flex<'d> { | 608 | pub 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))] | ||
| 867 | pub struct DormantWake<'w> { | 882 | pub struct DormantWake<'w> { |
| 868 | pin: Peri<'w, AnyPin>, | 883 | pin: Peri<'w, AnyPin>, |
| 869 | cfg: DormantWakeConfig, | 884 | cfg: DormantWakeConfig, |
