nrf52832_pac/spi0/psel/
mosi.rs1#[doc = "Register `MOSI` reader"]
2pub struct R(crate::R<MOSI_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<MOSI_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<MOSI_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<MOSI_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `MOSI` writer"]
17pub struct W(crate::W<MOSI_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<MOSI_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<MOSI_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<MOSI_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `PSELMOSI` reader - Pin number configuration for SPI MOSI signal"]
38pub type PSELMOSI_R = crate::FieldReader<u32, PSELMOSI_A>;
39#[doc = "Pin number configuration for SPI MOSI signal\n\nValue on reset: 4294967295"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41#[repr(u32)]
42pub enum PSELMOSI_A {
43 #[doc = "4294967295: Disconnect"]
44 DISCONNECTED = 4294967295,
45}
46impl From<PSELMOSI_A> for u32 {
47 #[inline(always)]
48 fn from(variant: PSELMOSI_A) -> Self {
49 variant as _
50 }
51}
52impl PSELMOSI_R {
53 #[doc = "Get enumerated values variant"]
54 #[inline(always)]
55 pub fn variant(&self) -> Option<PSELMOSI_A> {
56 match self.bits {
57 4294967295 => Some(PSELMOSI_A::DISCONNECTED),
58 _ => None,
59 }
60 }
61 #[doc = "Checks if the value of the field is `DISCONNECTED`"]
62 #[inline(always)]
63 pub fn is_disconnected(&self) -> bool {
64 *self == PSELMOSI_A::DISCONNECTED
65 }
66}
67#[doc = "Field `PSELMOSI` writer - Pin number configuration for SPI MOSI signal"]
68pub type PSELMOSI_W<'a, const O: u8> =
69 crate::FieldWriter<'a, u32, MOSI_SPEC, u32, PSELMOSI_A, 32, O>;
70impl<'a, const O: u8> PSELMOSI_W<'a, O> {
71 #[doc = "Disconnect"]
72 #[inline(always)]
73 pub fn disconnected(self) -> &'a mut W {
74 self.variant(PSELMOSI_A::DISCONNECTED)
75 }
76}
77impl R {
78 #[doc = "Bits 0:31 - Pin number configuration for SPI MOSI signal"]
79 #[inline(always)]
80 pub fn pselmosi(&self) -> PSELMOSI_R {
81 PSELMOSI_R::new(self.bits)
82 }
83}
84impl W {
85 #[doc = "Bits 0:31 - Pin number configuration for SPI MOSI signal"]
86 #[inline(always)]
87 pub fn pselmosi(&mut self) -> PSELMOSI_W<0> {
88 PSELMOSI_W::new(self)
89 }
90 #[doc = "Writes raw bits to the register."]
91 #[inline(always)]
92 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
93 self.0.bits(bits);
94 self
95 }
96}
97#[doc = "Pin select for MOSI\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mosi](index.html) module"]
98pub struct MOSI_SPEC;
99impl crate::RegisterSpec for MOSI_SPEC {
100 type Ux = u32;
101}
102#[doc = "`read()` method returns [mosi::R](R) reader structure"]
103impl crate::Readable for MOSI_SPEC {
104 type Reader = R;
105}
106#[doc = "`write(|w| ..)` method takes [mosi::W](W) writer structure"]
107impl crate::Writable for MOSI_SPEC {
108 type Writer = W;
109}
110#[doc = "`reset()` method sets MOSI to value 0xffff_ffff"]
111impl crate::Resettable for MOSI_SPEC {
112 #[inline(always)]
113 fn reset_value() -> Self::Ux {
114 0xffff_ffff
115 }
116}