diff options
| author | goodhoko <[email protected]> | 2025-09-16 00:52:59 +0200 |
|---|---|---|
| committer | goodhoko <[email protected]> | 2025-09-16 00:57:23 +0200 |
| commit | 337da33c7a127b083652d635d956f03d79a952bc (patch) | |
| tree | 87c60cced9c638f6f65fcf56b95931eaee6b1e95 | |
| parent | 759ea1deb96f2070b09b6d812538c4ffd76e8477 (diff) | |
Also derive for enums that aren't available under my feature-set
| -rw-r--r-- | embassy-stm32/src/qspi/enums.rs | 7 | ||||
| -rw-r--r-- | embassy-stm32/src/xspi/enums.rs | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/embassy-stm32/src/qspi/enums.rs b/embassy-stm32/src/qspi/enums.rs index fa5e36d06..8a8420127 100644 --- a/embassy-stm32/src/qspi/enums.rs +++ b/embassy-stm32/src/qspi/enums.rs | |||
| @@ -23,6 +23,7 @@ impl From<QspiMode> for u8 { | |||
| 23 | /// QSPI lane width | 23 | /// QSPI lane width |
| 24 | #[allow(dead_code)] | 24 | #[allow(dead_code)] |
| 25 | #[derive(Copy, Clone)] | 25 | #[derive(Copy, Clone)] |
| 26 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 26 | pub enum QspiWidth { | 27 | pub enum QspiWidth { |
| 27 | /// None | 28 | /// None |
| 28 | NONE, | 29 | NONE, |
| @@ -67,6 +68,7 @@ impl From<FlashSelection> for bool { | |||
| 67 | /// QSPI memory size. | 68 | /// QSPI memory size. |
| 68 | #[allow(missing_docs)] | 69 | #[allow(missing_docs)] |
| 69 | #[derive(Copy, Clone)] | 70 | #[derive(Copy, Clone)] |
| 71 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 70 | pub enum MemorySize { | 72 | pub enum MemorySize { |
| 71 | _1KiB, | 73 | _1KiB, |
| 72 | _2KiB, | 74 | _2KiB, |
| @@ -127,6 +129,7 @@ impl From<MemorySize> for u8 { | |||
| 127 | 129 | ||
| 128 | /// QSPI Address size | 130 | /// QSPI Address size |
| 129 | #[derive(Copy, Clone)] | 131 | #[derive(Copy, Clone)] |
| 132 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 130 | pub enum AddressSize { | 133 | pub enum AddressSize { |
| 131 | /// 8-bit address | 134 | /// 8-bit address |
| 132 | _8Bit, | 135 | _8Bit, |
| @@ -152,6 +155,7 @@ impl From<AddressSize> for u8 { | |||
| 152 | /// Time the Chip Select line stays high. | 155 | /// Time the Chip Select line stays high. |
| 153 | #[allow(missing_docs)] | 156 | #[allow(missing_docs)] |
| 154 | #[derive(Copy, Clone)] | 157 | #[derive(Copy, Clone)] |
| 158 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 155 | pub enum ChipSelectHighTime { | 159 | pub enum ChipSelectHighTime { |
| 156 | _1Cycle, | 160 | _1Cycle, |
| 157 | _2Cycle, | 161 | _2Cycle, |
| @@ -181,6 +185,7 @@ impl From<ChipSelectHighTime> for u8 { | |||
| 181 | /// FIFO threshold. | 185 | /// FIFO threshold. |
| 182 | #[allow(missing_docs)] | 186 | #[allow(missing_docs)] |
| 183 | #[derive(Copy, Clone)] | 187 | #[derive(Copy, Clone)] |
| 188 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 184 | pub enum FIFOThresholdLevel { | 189 | pub enum FIFOThresholdLevel { |
| 185 | _1Bytes, | 190 | _1Bytes, |
| 186 | _2Bytes, | 191 | _2Bytes, |
| @@ -258,6 +263,7 @@ impl From<FIFOThresholdLevel> for u8 { | |||
| 258 | /// Dummy cycle count | 263 | /// Dummy cycle count |
| 259 | #[allow(missing_docs)] | 264 | #[allow(missing_docs)] |
| 260 | #[derive(Copy, Clone)] | 265 | #[derive(Copy, Clone)] |
| 266 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 261 | pub enum DummyCycles { | 267 | pub enum DummyCycles { |
| 262 | _0, | 268 | _0, |
| 263 | _1, | 269 | _1, |
| @@ -334,6 +340,7 @@ impl From<DummyCycles> for u8 { | |||
| 334 | 340 | ||
| 335 | #[allow(missing_docs)] | 341 | #[allow(missing_docs)] |
| 336 | #[derive(Copy, Clone)] | 342 | #[derive(Copy, Clone)] |
| 343 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 337 | pub enum SampleShifting { | 344 | pub enum SampleShifting { |
| 338 | None, | 345 | None, |
| 339 | HalfCycle, | 346 | HalfCycle, |
diff --git a/embassy-stm32/src/xspi/enums.rs b/embassy-stm32/src/xspi/enums.rs index c96641180..2e510fada 100644 --- a/embassy-stm32/src/xspi/enums.rs +++ b/embassy-stm32/src/xspi/enums.rs | |||
| @@ -22,6 +22,7 @@ impl Into<u8> for XspiMode { | |||
| 22 | 22 | ||
| 23 | /// Xspi lane width | 23 | /// Xspi lane width |
| 24 | #[derive(Copy, Clone)] | 24 | #[derive(Copy, Clone)] |
| 25 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 25 | pub enum XspiWidth { | 26 | pub enum XspiWidth { |
| 26 | /// None | 27 | /// None |
| 27 | NONE, | 28 | NONE, |
| @@ -50,6 +51,7 @@ impl Into<u8> for XspiWidth { | |||
| 50 | /// Wrap Size | 51 | /// Wrap Size |
| 51 | #[allow(missing_docs)] | 52 | #[allow(missing_docs)] |
| 52 | #[derive(Copy, Clone)] | 53 | #[derive(Copy, Clone)] |
| 54 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 53 | pub enum WrapSize { | 55 | pub enum WrapSize { |
| 54 | None, | 56 | None, |
| 55 | _16Bytes, | 57 | _16Bytes, |
| @@ -73,6 +75,7 @@ impl Into<u8> for WrapSize { | |||
| 73 | /// Memory Type | 75 | /// Memory Type |
| 74 | #[allow(missing_docs)] | 76 | #[allow(missing_docs)] |
| 75 | #[derive(Copy, Clone)] | 77 | #[derive(Copy, Clone)] |
| 78 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 76 | pub enum MemoryType { | 79 | pub enum MemoryType { |
| 77 | Micron, | 80 | Micron, |
| 78 | Macronix, | 81 | Macronix, |
| @@ -98,6 +101,7 @@ impl Into<u8> for MemoryType { | |||
| 98 | /// Xspi memory size. | 101 | /// Xspi memory size. |
| 99 | #[allow(missing_docs)] | 102 | #[allow(missing_docs)] |
| 100 | #[derive(Copy, Clone)] | 103 | #[derive(Copy, Clone)] |
| 104 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 101 | pub enum MemorySize { | 105 | pub enum MemorySize { |
| 102 | _1KiB, | 106 | _1KiB, |
| 103 | _2KiB, | 107 | _2KiB, |
| @@ -158,6 +162,7 @@ impl Into<u8> for MemorySize { | |||
| 158 | 162 | ||
| 159 | /// Xspi Address size | 163 | /// Xspi Address size |
| 160 | #[derive(Copy, Clone)] | 164 | #[derive(Copy, Clone)] |
| 165 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 161 | pub enum AddressSize { | 166 | pub enum AddressSize { |
| 162 | /// 8-bit address | 167 | /// 8-bit address |
| 163 | _8bit, | 168 | _8bit, |
| @@ -183,6 +188,7 @@ impl Into<u8> for AddressSize { | |||
| 183 | /// Time the Chip Select line stays high. | 188 | /// Time the Chip Select line stays high. |
| 184 | #[allow(missing_docs)] | 189 | #[allow(missing_docs)] |
| 185 | #[derive(Copy, Clone)] | 190 | #[derive(Copy, Clone)] |
| 191 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 186 | pub enum ChipSelectHighTime { | 192 | pub enum ChipSelectHighTime { |
| 187 | _1Cycle, | 193 | _1Cycle, |
| 188 | _2Cycle, | 194 | _2Cycle, |
| @@ -212,6 +218,7 @@ impl Into<u8> for ChipSelectHighTime { | |||
| 212 | /// FIFO threshold. | 218 | /// FIFO threshold. |
| 213 | #[allow(missing_docs)] | 219 | #[allow(missing_docs)] |
| 214 | #[derive(Copy, Clone)] | 220 | #[derive(Copy, Clone)] |
| 221 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 215 | pub enum FIFOThresholdLevel { | 222 | pub enum FIFOThresholdLevel { |
| 216 | _1Bytes, | 223 | _1Bytes, |
| 217 | _2Bytes, | 224 | _2Bytes, |
| @@ -289,6 +296,7 @@ impl Into<u8> for FIFOThresholdLevel { | |||
| 289 | /// Dummy cycle count | 296 | /// Dummy cycle count |
| 290 | #[allow(missing_docs)] | 297 | #[allow(missing_docs)] |
| 291 | #[derive(Copy, Clone)] | 298 | #[derive(Copy, Clone)] |
| 299 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 292 | pub enum DummyCycles { | 300 | pub enum DummyCycles { |
| 293 | _0, | 301 | _0, |
| 294 | _1, | 302 | _1, |
