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
#[doc = r" Value read from the register"] pub struct R { bits: u16, } impl super::BLE_PART_ID { #[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 `BLE_PART_ID`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum BLE_PART_IDR { #[doc = "Pre-production"] _0, #[doc = "Pre-production"] _1, #[doc = "KW40Z"] _2, #[doc = "KW41Z"] _3, #[doc = r" Reserved"] _Reserved(u16), } impl BLE_PART_IDR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u16 { match *self { BLE_PART_IDR::_0 => 0, BLE_PART_IDR::_1 => 1, BLE_PART_IDR::_2 => 2, BLE_PART_IDR::_3 => 3, BLE_PART_IDR::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: u16) -> BLE_PART_IDR { match value { 0 => BLE_PART_IDR::_0, 1 => BLE_PART_IDR::_1, 2 => BLE_PART_IDR::_2, 3 => BLE_PART_IDR::_3, i => BLE_PART_IDR::_Reserved(i), } } #[doc = "Checks if the value of the field is `_0`"] #[inline] pub fn is_0(&self) -> bool { *self == BLE_PART_IDR::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline] pub fn is_1(&self) -> bool { *self == BLE_PART_IDR::_1 } #[doc = "Checks if the value of the field is `_2`"] #[inline] pub fn is_2(&self) -> bool { *self == BLE_PART_IDR::_2 } #[doc = "Checks if the value of the field is `_3`"] #[inline] pub fn is_3(&self) -> bool { *self == BLE_PART_IDR::_3 } } impl R { #[doc = r" Value of the register as raw bits"] #[inline] pub fn bits(&self) -> u16 { self.bits } #[doc = "Bits 0:15 - BLE Part ID"] #[inline] pub fn ble_part_id(&self) -> BLE_PART_IDR { BLE_PART_IDR::_from({ const MASK: u16 = 65535; const OFFSET: u8 = 0; ((self.bits >> OFFSET) & MASK as u16) as u16 }) } }