Skip to content

Commit b9509f3

Browse files
committed
Add typical derives to gpio enums
1 parent d79fff0 commit b9509f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gpio.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ impl<Otype> marker::Active for Output<Otype> {}
251251
impl<Otype, const AF: u8> marker::Active for Alternate<Otype, AF> {}
252252

253253
/// Slew rate configuration
254+
#[derive(Copy, Clone, PartialEq, Eq)]
255+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
254256
pub enum Speed {
255257
/// Low speed
256258
Low,
@@ -261,6 +263,8 @@ pub enum Speed {
261263
}
262264

263265
/// Internal pull-up and pull-down resistor configuration
266+
#[derive(Copy, Clone, PartialEq, Eq)]
267+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
264268
pub enum Resistor {
265269
/// Floating
266270
Floating,
@@ -271,6 +275,8 @@ pub enum Resistor {
271275
}
272276

273277
/// GPIO interrupt trigger edge selection
278+
#[derive(Copy, Clone, PartialEq, Eq)]
279+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
274280
pub enum Edge {
275281
/// Rising edge of voltage
276282
Rising,

0 commit comments

Comments
 (0)