1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
#[doc = r" Value read from the register"] pub struct R { bits: u32, } impl super::STATE { #[doc = r" Reads the contents of the register"] #[inline] pub fn read(&self) -> R { R { bits: self.register.get(), } } } #[doc = "Possible values of the field `STATE`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum STATER { #[doc = "RADIO is in the Disabled state"] DISABLED, #[doc = "RADIO is in the RXRU state"] RXRU, #[doc = "RADIO is in the RXIDLE state"] RXIDLE, #[doc = "RADIO is in the RX state"] RX, #[doc = "RADIO is in the RXDISABLED state"] RXDISABLE, #[doc = "RADIO is in the TXRU state"] TXRU, #[doc = "RADIO is in the TXIDLE state"] TXIDLE, #[doc = "RADIO is in the TX state"] TX, #[doc = "RADIO is in the TXDISABLED state"] TXDISABLE, #[doc = r" Reserved"] _Reserved(u8), } impl STATER { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { STATER::DISABLED => 0, STATER::RXRU => 1, STATER::RXIDLE => 2, STATER::RX => 3, STATER::RXDISABLE => 4, STATER::TXRU => 9, STATER::TXIDLE => 10, STATER::TX => 11, STATER::TXDISABLE => 12, STATER::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u8) -> STATER { match value { 0 => STATER::DISABLED, 1 => STATER::RXRU, 2 => STATER::RXIDLE, 3 => STATER::RX, 4 => STATER::RXDISABLE, 9 => STATER::TXRU, 10 => STATER::TXIDLE, 11 => STATER::TX, 12 => STATER::TXDISABLE, i => STATER::_Reserved(i), } } #[doc = "Checks if the value of the field is `DISABLED`"] #[inline] pub fn is_disabled(&self) -> bool { *self == STATER::DISABLED } #[doc = "Checks if the value of the field is `RXRU`"] #[inline] pub fn is_rx_ru(&self) -> bool { *self == STATER::RXRU } #[doc = "Checks if the value of the field is `RXIDLE`"] #[inline] pub fn is_rx_idle(&self) -> bool { *self == STATER::RXIDLE } #[doc = "Checks if the value of the field is `RX`"] #[inline] pub fn is_rx(&self) -> bool { *self == STATER::RX } #[doc = "Checks if the value of the field is `RXDISABLE`"] #[inline] pub fn is_rx_disable(&self) -> bool { *self == STATER::RXDISABLE } #[doc = "Checks if the value of the field is `TXRU`"] #[inline] pub fn is_tx_ru(&self) -> bool { *self == STATER::TXRU } #[doc = "Checks if the value of the field is `TXIDLE`"] #[inline] pub fn is_tx_idle(&self) -> bool { *self == STATER::TXIDLE } #[doc = "Checks if the value of the field is `TX`"] #[inline] pub fn is_tx(&self) -> bool { *self == STATER::TX } #[doc = "Checks if the value of the field is `TXDISABLE`"] #[inline] pub fn is_tx_disable(&self) -> bool { *self == STATER::TXDISABLE } } impl R { #[doc = r" Value of the register as raw bits"] #[inline] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bits 0:3 - Current radio state"] #[inline] pub fn state(&self) -> STATER { STATER::_from({ const MASK: u8 = 15; const OFFSET: u8 = 0; ((self.bits >> OFFSET) & MASK as u32) as u8 }) } }