@@ -81,6 +81,8 @@ pub const DEFAULT_SFD: u8 = 0xA7;
8181
8282// TODO expose the other variants in `pac::CCAMODE_A`
8383/// Clear Channel Assessment method
84+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
85+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
8486pub enum Cca {
8587 /// Carrier sense
8688 CarrierSense ,
@@ -98,6 +100,8 @@ pub enum Cca {
98100/// IEEE 802.15.4 channels
99101///
100102/// NOTE these are NOT the same as WiFi 2.4 GHz channels
103+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
104+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
101105pub enum Channel {
102106 /// 2_405 MHz
103107 _11 = 5 ,
@@ -135,7 +139,8 @@ pub enum Channel {
135139
136140/// Transmission power in dBm (decibel milliwatt)
137141// TXPOWERA enum minus the deprecated Neg30dBm variant and with better docs
138- #[ derive( Clone , Copy , PartialEq ) ]
142+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
143+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
139144pub enum TxPower {
140145 /// +8 dBm
141146 Pos8dBm ,
@@ -732,6 +737,7 @@ impl<'c> Radio<'c> {
732737
733738/// Error
734739#[ derive( Copy , Clone , Debug , PartialEq ) ]
740+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
735741pub enum Error {
736742 /// Incorrect CRC
737743 Crc ( u16 ) ,
@@ -744,22 +750,27 @@ pub enum Error {
744750/// After, or at the start of, any method call the RADIO will be in one of these states
745751// This is a subset of the STATE_A enum
746752#[ derive( Copy , Clone , PartialEq ) ]
753+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
747754enum State {
748755 Disabled ,
749756 RxIdle ,
750757 TxIdle ,
751758}
752759
753760/// NOTE must be followed by a volatile write operation
761+ #[ inline]
754762fn dma_start_fence ( ) {
755763 atomic:: compiler_fence ( Ordering :: Release ) ;
756764}
757765
758766/// NOTE must be preceded by a volatile read operation
767+ #[ inline]
759768fn dma_end_fence ( ) {
760769 atomic:: compiler_fence ( Ordering :: Acquire ) ;
761770}
762771
772+ #[ derive( Debug ) ]
773+ #[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
763774enum Event {
764775 PhyEnd ,
765776}
0 commit comments